From 24952f49e5a82373c9205307baa2fcf87008734d Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 17 Jul 2011 13:35:32 +0000 Subject: [PATCH] Do not claim to listen on a socket until we actually do. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch submitted by Petr Písař in #3354485 --- jcc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/jcc.c b/jcc.c index 271b1d17..306183ae 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.357 2011/07/17 13:31:02 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.358 2011/07/17 13:34:36 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -3339,17 +3339,6 @@ static jb_socket bind_port_helper(const char *haddr, int hport) int result; jb_socket bfd; - if (haddr == NULL) - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", - hport); - } - else - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", - hport, haddr); - } - result = bind_port(haddr, hport, &bfd); if (result < 0) @@ -3376,6 +3365,17 @@ static jb_socket bind_port_helper(const char *haddr, int hport) return JB_INVALID_SOCKET; } + if (haddr == NULL) + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", + hport); + } + else + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", + hport, haddr); + } + return bfd; } -- 2.39.2