From 8d1af2b7fe1b6088811aafbdad127133457028fd Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 27 Nov 2014 21:48:02 +1100 Subject: [PATCH] Check for presence of main process before trying to ping it in case the socket is pointing a new process --- src/ckpool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ckpool.c b/src/ckpool.c index 252c9a7f..dc5feab6 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -350,8 +350,10 @@ bool ping_main(ckpool_t *ckp) { char *buf; + if (unlikely(kill_pid(ckp->main.pid, 0))) + return false; buf = send_recv_proc(&ckp->main, "ping"); - if (!buf) + if (unlikely(!buf)) return false; free(buf); return true;