mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-18 22:40:33 +01:00
core: replace "dup()" by "fcntl(fd, F_DUPFD_CLOEXEC, 0)"
(cherry picked from commit 1e572ebf87)
This commit is contained in:
parent
a792a7f9c3
commit
f000c76be4
2 changed files with 2 additions and 2 deletions
|
|
@ -2835,7 +2835,7 @@ 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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1318,7 +1318,7 @@ svWriteFile (shvarFile *s, int mode, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
tmpfd = dup (s->fd);
|
||||
tmpfd = fcntl (s->fd, F_DUPFD_CLOEXEC, 0);
|
||||
if (tmpfd == -1) {
|
||||
int errsv = errno;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue