projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
440713e
)
Bug 613601 - buglet in dup_close_on_exec_fd()
author
Ryan Lortie
<desrt@desrt.ca>
Mon, 22 Mar 2010 16:59:08 +0000
(11:59 -0500)
committer
Ryan Lortie
<desrt@desrt.ca>
Mon, 22 Mar 2010 17:03:24 +0000
(12:03 -0500)
Fix copy/paste error and 'or' FD_CLOEXEC into the existing flags instead
of just setting it outright.
gio/gunixfdlist.c
patch
|
blob
|
history
diff --git
a/gio/gunixfdlist.c
b/gio/gunixfdlist.c
index
df715b2
..
026c127
100644
(file)
--- a/
gio/gunixfdlist.c
+++ b/
gio/gunixfdlist.c
@@
-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;