From 33508b2243818bea6c96037800ced4a59da3d0c5 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 21 Feb 2015 09:47:37 +1100 Subject: [PATCH] Reset the pi pid after a failure to find the process alive so we can look it up again in case it has changed --- src/ckpool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ckpool.c b/src/ckpool.c index 989b1b65..b4b280f4 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -589,6 +589,9 @@ char *_send_recv_proc(proc_instance_t *pi, const char *msg, const char *file, co if (unlikely(!pi->pid)) pi->pid = get_proc_pid(pi); if (unlikely(kill_pid(pi->pid, 0))) { + /* Reset the pid value in case we are still looking for an old + * process */ + pi->pid = 0; LOGALERT("Attempting to send message %s to dead process %s", msg, pi->processname); goto out; }