all: pass O_CLOEXEC flag to g_mkstemp()

This commit is contained in:
Thomas Haller
2018-09-12 16:31:59 +02:00
parent bbc88cd07f
commit 20a7e489ee
2 changed files with 3 additions and 2 deletions

View File

@@ -351,7 +351,7 @@ nm_utils_file_set_contents (const char *filename,
length = strlen (contents);
tmp_name = g_strdup_printf ("%s.XXXXXX", filename);
fd = g_mkstemp_full (tmp_name, O_RDWR, mode);
fd = g_mkstemp_full (tmp_name, O_RDWR | O_CLOEXEC, mode);
if (fd < 0) {
errsv = errno;
g_set_error (error,