* shut down clean in case of not being able to bind.
[citadel.git] / webcit / webserver.c
index a4fcdef03c28465e528abcafdb14571f5f074caa..c3263ecb7820fb1d4e5abbf4197087aa60021aeb 100644 (file)
@@ -552,6 +552,11 @@ int main(int argc, char **argv)
                lprintf(2, "Attempting to bind to port %d...\n", http_port);
                msock = ig_tcp_server(ip_addr, http_port, LISTEN_QUEUE_LENGTH);
        }
+       if (msock < 0)
+       {
+               ShutDownWebcit();
+               return -msock;
+       }
 
        lprintf(2, "Listening on socket %d\n", msock);
        signal(SIGPIPE, SIG_IGN);