diff options
-rw-r--r-- | pullreqd.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -148,9 +148,10 @@ int init_socket(config *cfg) { return -1; } + /* Did we fail to bind the listen socket? */ if (bind(fd, &sock_addr.sa, sockaddr_size) < 0) { - syslog(LOG_ERR, "Failed to bind listen socket."); + syslog(LOG_ERR, "Failed to bind listen socket. Reason: %s", strerror(errno)); return -1; } @@ -158,13 +159,13 @@ int init_socket(config *cfg) { /* Did we fail to enable SO_REUSEADDR? */ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) { - syslog(LOG_ERR, "Failed to enable SO_REUSEADDR."); + syslog(LOG_ERR, "Failed to enable SO_REUSEADDR. Reason: %s", strerror(errno)); return -1; } /* Did we fail to listen to the socket? */ if (listen(fd, 20) < 0) { - syslog(LOG_ERR, "Failed to listen to socket."); + syslog(LOG_ERR, "Failed to listen to socket. Reason: %s", strerror(errno)); return -1; } |