]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/conn.c
if we can't bind a socket we now Log the port number, too.
[ngircd.git] / src / ngircd / conn.c
index 60128eae429d3439025dc7d558485c9a8be9ae23..6932af0fc559acd1126978a61b91efbf6a12dfcd 100644 (file)
@@ -17,7 +17,7 @@
 #include "portab.h"
 #include "io.h"
 
-static char UNUSED id[] = "$Id: conn.c,v 1.201 2006/12/25 01:11:12 fw Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.203 2007/02/21 11:06:06 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -123,7 +123,6 @@ cb_connserver(int sock, UNUSED short what)
 {
        int res, err;
        socklen_t sock_len;
-       CLIENT *c;
        CONN_ID idx = Socket2Index( sock );
        if (idx <= NONE) {
                LogDebug("cb_connserver wants to write on unknown socket?!");
@@ -150,14 +149,7 @@ cb_connserver(int sock, UNUSED short what)
                            Conf_Server[Conf_GetServer(idx)].port,
                            idx, strerror(err));
 
-               /* Clean up the CLIENT structure (to avoid silly log
-                * messages) and call Conn_Close() to do the rest. */
-               c = Conn_GetClient(idx);
-               if (c)
-                       Client_DestroyNow(c);
-               Conn_Close(idx, "Can't connect!", NULL, false);
+               Conn_Close(idx, "Can't connect!", NULL, false);
                return;
        }
 
@@ -384,7 +376,7 @@ NewListener( const UINT16 Port )
        if( ! Init_Socket( sock )) return -1;
 
        if (bind(sock, (struct sockaddr *)&addr, (socklen_t)sizeof(addr)) != 0) {
-               Log( LOG_CRIT, "Can't bind socket: %s!", strerror( errno ));
+               Log( LOG_CRIT, "Can't bind socket (port %d) : %s!", Port, strerror( errno ));
                close( sock );
                return -1;
        }