diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-11 07:34:02 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-11 07:34:02 -0400 |
commit | 5fbc6d8782715e0366f3d7e87e3ddb0dc4a8131d (patch) | |
tree | 545e761ab8b096f7ef1b51fd6cceee80a6c9c7de /pullreqd.c | |
parent | 11163d111cd7b07bbb518b2fe31a45c050ac80f1 (diff) |
Added failure reasons to all the failure log messages
in `init_socket()`.
Diffstat (limited to 'pullreqd.c')
-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; } |