From 4c47cbcc5c3ebf0bc5a2bbf13b7cd5d64c765f0d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 7 Feb 2017 18:21:29 +0100 Subject: add code to silence false positive warning in gcc6.3 --- src/exchange/taler-exchange-httpd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/exchange/taler-exchange-httpd.c') diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index f1661b003..11cf00dd1 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -1125,12 +1125,16 @@ main (int argc, { MHD_socket sock = MHD_quiesce_daemon (mhd); MHD_socket admin_sock; + int admin_sock_opened = GNUNET_NO; pid_t chld; int flags; /* Set flags to make 'sock' inherited by child */ if (NULL != mhd_admin) + { admin_sock = MHD_quiesce_daemon (mhd_admin); + admin_sock_opened = GNUNET_YES; + } flags = fcntl (sock, F_GETFD); GNUNET_assert (-1 != flags); flags &= ~FD_CLOEXEC; @@ -1154,7 +1158,7 @@ main (int argc, "dup2"); _exit (1); } - if ( (NULL != mhd_admin) && + if ( (GNUNET_YES == admin_sock_opened) && (4 != dup2 (admin_sock, 4)) ) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, @@ -1179,7 +1183,7 @@ main (int argc, before exiting; as the listen socket is no longer used, close it here */ GNUNET_break (0 == close (sock)); - if (NULL != mhd_admin) + if (GNUNET_YES == admin_sock_opened) GNUNET_break (0 == close (admin_sock)); while ( (0 != MHD_get_daemon_info (mhd, MHD_DAEMON_INFO_CURRENT_CONNECTIONS)->num_connections) || -- cgit v1.2.3