From: Christian Grothoff Date: Wed, 23 Jun 2010 14:23:10 +0000 (+0000) Subject: cleaning X-Git-Tag: initial-import-from-subversion-38251~21257 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=503c232f343876114549031bab91f2d5025e8c1a;p=oweals%2Fgnunet.git cleaning --- diff --git a/src/util/network.c b/src/util/network.c index 4a287ada9..69b36bc51 100644 --- 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