From: Florian Westphal Date: Mon, 12 May 2008 16:46:55 +0000 (+0200) Subject: If bind() fails, also print ip address and not just the port number. X-Git-Tag: rel-13-rc1~114 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=b1d38de4d23e78ec27c11277a007c202e3edcd38 If bind() fails, also print ip address and not just the port number. --- diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index d6542e23..4772fd34 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -415,11 +415,13 @@ NewListener(int af, const UINT16 Port) set_v6_only(af, sock); - if( ! Init_Socket( sock )) return -1; + if (!Init_Socket(sock)) + return -1; if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) { - Log( LOG_CRIT, "Can't bind socket (port %d) : %s!", Port, strerror( errno )); - close( sock ); + Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s", + ng_ipaddr_tostr(&addr), Port, strerror(errno)); + close(sock); return -1; }