summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-11 07:34:02 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-11 07:34:02 -0400
commit5fbc6d8782715e0366f3d7e87e3ddb0dc4a8131d (patch)
tree545e761ab8b096f7ef1b51fd6cceee80a6c9c7de /pullreqd.c
parent11163d111cd7b07bbb518b2fe31a45c050ac80f1 (diff)
Added failure reasons to all the failure log messages
in `init_socket()`.
Diffstat (limited to 'pullreqd.c')
-rw-r--r--pullreqd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pullreqd.c b/pullreqd.c
index 4e04f5b..a00d85c 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -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;
}