summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-10-06 21:23:29 +0200
committerChristian Grothoff <christian@grothoff.org>2017-10-06 21:23:29 +0200
commit8f08e4634f0e2cb61d288ecc061d75e78c27fd30 (patch)
tree9bdc45ca4c3aa0b8d20e1e7516c3a504a4db2f37
parent7f37c2ae00cb6b51f347c3a7520bb0a8cd493a13 (diff)
downloadexchange-8f08e4634f0e2cb61d288ecc061d75e78c27fd30.tar.gz
exchange-8f08e4634f0e2cb61d288ecc061d75e78c27fd30.tar.bz2
exchange-8f08e4634f0e2cb61d288ecc061d75e78c27fd30.zip
do not potentially pass -1 to fcntl()
-rw-r--r--src/exchange/taler-exchange-httpd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 0f874087..0dd3f968 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1060,9 +1060,10 @@ main (int argc,
fh_admin = -1;
}
flags |= FD_CLOEXEC;
- if (0 != fcntl (fh_admin,
- F_SETFD,
- flags))
+ if ( (-1 != fh_admin) &&
+ (0 != fcntl (fh_admin,
+ F_SETFD,
+ flags)) )
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
"fcntl");
}