sock: in listen_sock(), add debug message when socket() call failed.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 5392e9829c)
This commit is contained in:
Michael Adam 2013-11-08 11:39:23 +01:00
parent 844403afbe
commit 7b1801d8e7

View File

@ -195,8 +195,12 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
listenfd = socket (rp->ai_family, rp->ai_socktype, listenfd = socket (rp->ai_family, rp->ai_socktype,
rp->ai_protocol); rp->ai_protocol);
if (listenfd == -1) if (listenfd == -1) {
log_message(LOG_ERR,
"failed to create socket: %s",
strerror(errno));
continue; continue;
}
setsockopt (listenfd, SOL_SOCKET, SO_REUSEADDR, &on, setsockopt (listenfd, SOL_SOCKET, SO_REUSEADDR, &on,
sizeof (on)); sizeof (on));