projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9a9a91
)
cleaning
author
Christian Grothoff
<christian@grothoff.org>
Wed, 23 Jun 2010 14:23:10 +0000
(14:23 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Wed, 23 Jun 2010 14:23:10 +0000
(14:23 +0000)
src/util/network.c
patch
|
blob
|
history
diff --git
a/src/util/network.c
b/src/util/network.c
index 4a287ada9bcd9e0beffad04535b15310964e951f..69b36bc51b981c173678db76a14c8f53b97173bb 100644
(file)
--- a/
src/util/network.c
+++ b/
src/util/network.c
@@
-142,11
+142,16
@@
static int
socket_set_inheritable (const struct GNUNET_NETWORK_Handle *h)
{
int i;
- i = fcntl (h->fd, F_GETFD);
+
+ i = fcntl (h->fd, F_GETFD);
+ if (i < 0)
+ return GNUNET_SYSERR;
if (i == (i | FD_CLOEXEC))
return GNUNET_OK;
- return (fcntl (h->fd, F_SETFD, i | FD_CLOEXEC) == 0)
- ? GNUNET_OK : GNUNET_SYSERR;
+ i |= FD_CLOEXEC;
+ if (fcntl (h->fd, F_SETFD, i) < 0)
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
}
#endif