Restructure bind_ports_helper() a bit
authorFabian Keil <fk@fabiankeil.de>
Sun, 17 Jul 2011 13:36:06 +0000 (13:36 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 17 Jul 2011 13:36:06 +0000 (13:36 +0000)
Setting config->need_bind isn't necessary.

jcc.c

diff --git a/jcc.c b/jcc.c
index 306183a..f6b284b 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.358 2011/07/17 13:34:36 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.359 2011/07/17 13:35:32 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -3403,21 +3403,18 @@ static void bind_ports_helper(struct configuration_spec * config,
 {
    int i;
 
-   config->need_bind = 1;
-
    for (i = 0; i < MAX_LISTENING_SOCKETS; i++)
    {
-      sockets[i] = JB_INVALID_SOCKET;
-
       if (config->hport[i])
       {
          sockets[i] = bind_port_helper(config->haddr[i], config->hport[i]);
-         if (JB_INVALID_SOCKET != sockets[i])
-         {
-            config->need_bind = 0;
-         }
+      }
+      else
+      {
+         sockets[i] = JB_INVALID_SOCKET;
       }
    }
+   config->need_bind = 0;
 }