From 352792758c1747af8f16c7f9132ae5fda839bbee Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 9 Jun 2014 12:21:10 +1000 Subject: [PATCH] Send SIGTERM to the parent process on a failure to send a message to a sub process --- src/ckpool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ckpool.c b/src/ckpool.c index 64014054..f5766e2a 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -188,6 +188,8 @@ out: return ret; } +static void childsighandler(int sig); + /* Send a single message to a process instance when there will be no response, * closing the socket immediately. */ bool _send_proc(proc_instance_t *pi, const char *msg, const char *file, const char *func, const int line) @@ -219,8 +221,10 @@ bool _send_proc(proc_instance_t *pi, const char *msg, const char *file, const ch ret = true; close(sockd); out: - if (unlikely(!ret)) + if (unlikely(!ret)) { LOGERR("Failure in send_proc from %s %s:%d", file, func, line); + childsighandler(15); + } return ret; }