projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aeb9a8a
)
cloexec: Clarify code.
author
Bruno Haible
<bruno@clisp.org>
Wed, 9 Dec 2009 10:21:35 +0000
(11:21 +0100)
committer
Bruno Haible
<bruno@clisp.org>
Wed, 9 Dec 2009 10:21:35 +0000
(11:21 +0100)
ChangeLog
patch
|
blob
|
history
lib/cloexec.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 8597a13e945aad09ff7997a9a7e6801dcbd661db..871ac1ea86927ae9c2bd73e13cae8724aa4979b1 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,7
@@
+2009-12-09 Bruno Haible <bruno@clisp.org>
+
+ * lib/cloexec.c (set_cloexec_flag): Clarify intent of dup2 call.
+
2009-12-08 Eric Blake <ebb9@byu.net>
fchdir: avoid memory leak on re-registration.
diff --git
a/lib/cloexec.c
b/lib/cloexec.c
index 18985cb237da06f02338efc06d139e9fa2b53fb4..69b45b4a397f432643b0993b527564574fdd8c1c 100644
(file)
--- a/
lib/cloexec.c
+++ b/
lib/cloexec.c
@@
-71,8
+71,12
@@
set_cloexec_flag (int desc, bool value)
errno = EBADF;
return -1;
}
- return dup2 (desc, desc) == desc ? 0 : -1;
+ if (dup2 (desc, desc) < 0)
+ /* errno is EBADF here. */
+ return -1;
+ /* There is nothing we can do on this kind of platform. Punt. */
+ return 0;
#endif
}