1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 09:50:29 +00:00

NewListener(): Code cleanup

This commit is contained in:
Alexander Barton 2013-01-27 20:57:25 +01:00
parent 84a599ece4
commit 3a3b3225d4

View File

@ -621,7 +621,8 @@ NewListener(const char *listen_addr, UINT16 Port)
af = ng_ipaddr_af(&addr);
sock = socket(af, SOCK_STREAM, 0);
if (sock < 0) {
Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af, strerror(errno));
Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af,
strerror(errno));
return -1;
}
@ -645,7 +646,8 @@ NewListener(const char *listen_addr, UINT16 Port)
/* keep fd in list so we can close it when ngircd restarts/shuts down */
if (!array_catb(&My_Listeners, (char *)&sock, sizeof(int))) {
Log( LOG_CRIT, "Can't add socket to My_Listeners array: %s!", strerror( errno ));
Log(LOG_CRIT, "Can't add socket to My_Listeners array: %s!",
strerror(errno));
close(sock);
return -1;
}