projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3941f59
)
cloexec: Fix possible compilation error.
author
Bruno Haible
<bruno@clisp.org>
Mon, 7 Dec 2009 00:02:50 +0000
(
01:02
+0100)
committer
Bruno Haible
<bruno@clisp.org>
Mon, 7 Dec 2009 00:02:50 +0000
(
01:02
+0100)
ChangeLog
patch
|
blob
|
history
lib/cloexec.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index
be28f93
..
977285c
100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,5
+1,10
@@
2009-12-06 Bruno Haible <bruno@clisp.org>
2009-12-06 Bruno Haible <bruno@clisp.org>
+ * lib/cloexec.c (dup_cloexec): Fix handling of _gl_register_dup return
+ value.
+
+2009-12-06 Bruno Haible <bruno@clisp.org>
+
* lib/progname.c: Include stdio.h, stdlib.h.
(set_program_name): Reject a NULL argument.
* lib/progname.c: Include stdio.h, stdlib.h.
(set_program_name): Reject a NULL argument.
diff --git
a/lib/cloexec.c
b/lib/cloexec.c
index
b862cc6
..
5479477
100644
(file)
--- a/
lib/cloexec.c
+++ b/
lib/cloexec.c
@@
-79,7
+79,8
@@
set_cloexec_flag (int desc, bool value)
prior to exec or spawn. Returns -1 and sets errno if FD could not
be duplicated. */
prior to exec or spawn. Returns -1 and sets errno if FD could not
be duplicated. */
-int dup_cloexec (int fd)
+int
+dup_cloexec (int fd)
{
int nfd;
{
int nfd;
@@
-107,6
+108,7
@@
int dup_cloexec (int fd)
FALSE, /* InheritHandle */
DUPLICATE_SAME_ACCESS)) /* Options */
{
FALSE, /* InheritHandle */
DUPLICATE_SAME_ACCESS)) /* Options */
{
+ /* TODO: Translate GetLastError () into errno. */
errno = EMFILE;
return -1;
}
errno = EMFILE;
return -1;
}
@@
-133,12
+135,12
@@
int dup_cloexec (int fd)
nfd = fcntl (fd, F_DUPFD_CLOEXEC, 0);
# if REPLACE_FCHDIR
if (0 <= nfd)
nfd = fcntl (fd, F_DUPFD_CLOEXEC, 0);
# if REPLACE_FCHDIR
if (0 <= nfd)
-
result
= _gl_register_dup (fd, nfd);
+
nfd
= _gl_register_dup (fd, nfd);
# endif
# else /* !F_DUPFD_CLOEXEC */
nfd = dup (fd);
# endif
# else /* !F_DUPFD_CLOEXEC */
nfd = dup (fd);
- if (0 <= nfd && set_cloexec_flag (nfd, true))
+ if (0 <= nfd && set_cloexec_flag (nfd, true)
< 0
)
{
int saved_errno = errno;
close (nfd);
{
int saved_errno = errno;
close (nfd);