diff --git a/src/ckpool.c b/src/ckpool.c index dbd4c7ec..010f4a2a 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -45,6 +45,11 @@ retry: } /* Insert parsing and repeat code here */ buf = recv_unix_msg(sockd); + if (!buf) { + LOGWARNING("Failed to get message in listener"); + close(sockd); + goto retry; + } if (!strncasecmp(buf, "shutdown", 8)) { LOGWARNING("Listener received shutdown message, terminating ckpool"); close(sockd); diff --git a/src/libckpool.c b/src/libckpool.c index c3fde1f4..31df220e 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -701,7 +701,7 @@ out: * string.*/ char *recv_unix_msg(int sockd) { - tv_t tv_timeout = {1, 0}; + tv_t tv_timeout = {60, 0}; char *buf = NULL; uint32_t msglen; fd_set readfs; @@ -729,7 +729,7 @@ char *recv_unix_msg(int sockd) buf[msglen] = 0; ofs = 0; while (msglen) { - tv_timeout.tv_sec = 1; + tv_timeout.tv_sec = 60; tv_timeout.tv_usec = 0; FD_ZERO(&readfs);