[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 06/06: do not potentially pass -1 to fcntl
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 06/06: do not potentially pass -1 to fcntl() |
Date: |
Fri, 06 Oct 2017 21:11:45 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 800c54b19e9dd705a18e39e090d6227614b34f58
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Oct 6 21:06:47 2017 +0200
do not potentially pass -1 to fcntl()
---
src/exchange/taler-exchange-httpd.c | 37 +++++++++++++++++++++++++++----------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd.c
b/src/exchange/taler-exchange-httpd.c
index 60b7810..0f87408 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1015,37 +1015,54 @@ main (int argc,
listen_fds = getenv ("LISTEN_FDS");
if ( (NULL != listen_pid) &&
(NULL != listen_fds) &&
- (getpid() == strtol (listen_pid, NULL, 10)) &&
- ( (1 == strtoul (listen_fds, NULL, 10)) ||
- (2 == strtoul (listen_fds, NULL, 10)) ) )
+ (getpid() == strtol (listen_pid,
+ NULL,
+ 10)) &&
+ ( (1 == strtoul (listen_fds,
+ NULL,
+ 10)) ||
+ (2 == strtoul (listen_fds,
+ NULL,
+ 10)) ) )
{
int flags;
fh = 3;
- flags = fcntl (fh, F_GETFD);
- if ( (-1 == flags) && (EBADF == errno) )
+ flags = fcntl (fh,
+ F_GETFD);
+ if ( (-1 == flags) &&
+ (EBADF == errno) )
{
fprintf (stderr,
"Bad listen socket passed, ignored\n");
fh = -1;
}
flags |= FD_CLOEXEC;
- if (0 != fcntl (fh, F_SETFD, flags))
+ if ( (-1 != fh) &&
+ (0 != fcntl (fh,
+ F_SETFD,
+ flags)) )
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
"fcntl");
- if (2 == strtoul (listen_fds, NULL, 10))
+ if (2 == strtoul (listen_fds,
+ NULL,
+ 10))
{
fh_admin = 4;
- flags = fcntl (fh_admin, F_GETFD);
- if ( (-1 == flags) && (EBADF == errno) )
+ flags = fcntl (fh_admin,
+ F_GETFD);
+ if ( (-1 == flags) &&
+ (EBADF == errno) )
{
fprintf (stderr,
"Bad listen socket passed, ignored\n");
fh_admin = -1;
}
flags |= FD_CLOEXEC;
- if (0 != fcntl (fh_admin, F_SETFD, flags))
+ if (0 != fcntl (fh_admin,
+ F_SETFD,
+ flags))
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
"fcntl");
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-exchange] branch master updated (85a2d3d -> 800c54b), gnunet, 2017/10/06
- [GNUnet-SVN] [taler-exchange] 06/06: do not potentially pass -1 to fcntl(),
gnunet <=
- [GNUnet-SVN] [taler-exchange] 04/06: check return value from TALER_amount_get_zero, gnunet, 2017/10/06
- [GNUnet-SVN] [taler-exchange] 02/06: fix indentation, gnunet, 2017/10/06
- [GNUnet-SVN] [taler-exchange] 01/06: fix signed calls to isalpha/isdigit/isspace etc., gnunet, 2017/10/06
- [GNUnet-SVN] [taler-exchange] 03/06: check return value from TALER_JSON_hash, gnunet, 2017/10/06
- [GNUnet-SVN] [taler-exchange] 05/06: better logging if IBAN validation fails, also avoid potentially unbounded stack allocation, gnunet, 2017/10/06