mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Bug 613601 - buglet in dup_close_on_exec_fd()
Fix copy/paste error and 'or' FD_CLOEXEC into the existing flags instead of just setting it outright.
This commit is contained in:
parent
440713e393
commit
ace9a25fb3
@ -117,10 +117,15 @@ dup_close_on_exec_fd (gint fd,
|
||||
}
|
||||
|
||||
do
|
||||
s = fcntl (new_fd, F_SETFD, FD_CLOEXEC);
|
||||
{
|
||||
s = fcntl (new_fd, F_GETFD);
|
||||
|
||||
if (s >= 0)
|
||||
s = fcntl (new_fd, F_SETFD, (long) (s | FD_CLOEXEC));
|
||||
}
|
||||
while (s < 0 && (errno == EINTR));
|
||||
|
||||
if (new_fd < 0)
|
||||
if (s < 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user