summaryrefslogtreecommitdiffhomepage
path: root/src/sock.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-08 11:39:23 +0100
committerMichael Adam <obnox@samba.org>2013-11-09 13:34:33 +0100
commit5392e9829c186b5d09f135c7f379f18f0738745a (patch)
treeb403345507d1577d326944c6dcc440f6163f4bf5 /src/sock.c
parentfa26ad4d566f2c3a34f1c6e7158a9268267f2582 (diff)
sock: in listen_sock(), add debug message when socket() call failed.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src/sock.c')
-rw-r--r--src/sock.c6
1 files changed, 5 insertions, 1 deletions
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));