diff options
| author | Michael Biebl <biebl@debian.org> | 2017-12-12 15:53:07 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-12-12 15:53:07 +0100 |
| commit | afcd268ea7b1149fbfb66bce4eca659b675da0a2 (patch) | |
| tree | c3fca2203ad17434daf3ccf576582bd66aa41ab2 /src/nm-core-utils.c | |
| parent | 417f6015c3dc8c47cf27daa59f64e0e36c521b9c (diff) | |
New upstream version 1.10.2 upstream/1.10.2
Diffstat (limited to 'src/nm-core-utils.c')
| -rw-r--r-- | src/nm-core-utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index a8ff3513..40a0c352 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2835,13 +2835,13 @@ nm_utils_fd_get_contents (int fd, if (fd_keeper >= 0) fd2 = nm_steal_fd (&fd_keeper); else { - fd2 = dup (fd); + fd2 = fcntl (fd, F_DUPFD_CLOEXEC, 0); if (fd2 < 0) return _get_contents_error (error, 0, "error during dup"); } if (!(f = fdopen (fd2, "r"))) { - close (fd2); + nm_close (fd2); return _get_contents_error (error, 0, "failure during fdopen"); } @@ -4119,7 +4119,7 @@ nm_utils_file_set_contents (const gchar *filename, if (errsv == EINTR) continue; - close (fd); + nm_close (fd); unlink (tmp_name); g_set_error (error, @@ -4148,7 +4148,7 @@ nm_utils_file_set_contents (const gchar *filename, && fsync (fd) != 0) { errsv = errno; - close (fd); + nm_close (fd); unlink (tmp_name); g_set_error (error, @@ -4160,7 +4160,7 @@ nm_utils_file_set_contents (const gchar *filename, return FALSE; } - close (fd); + nm_close (fd); if (rename (tmp_name, filename)) { errsv = errno; |