From 5392e9829c186b5d09f135c7f379f18f0738745a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 8 Nov 2013 11:39:23 +0100 Subject: sock: in listen_sock(), add debug message when socket() call failed. Signed-off-by: Michael Adam --- src/sock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sock.c b/src/sock.c index 113ea88..b95f69c 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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, rp->ai_protocol); - if (listenfd == -1) + if (listenfd == -1) { + log_message(LOG_ERR, + "failed to create socket: %s", + strerror(errno)); continue; + } setsockopt (listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)); -- cgit v1.2.3