projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
cloexec: Clarify code.
[gnulib.git]
/
lib
/
cloexec.c
diff --git
a/lib/cloexec.c
b/lib/cloexec.c
index
18985cb
..
69b45b4
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
}