handle killpg error

Fri, 24 May 2024 20:24:39 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 24 May 2024 20:24:39 +0200
changeset 526
6c06b845701a
parent 525
072d7794bcca
child 527
bc6b4f3d92af

handle killpg error

src/server/safs/cgi.c file | annotate | diff | comparison | revisions
--- a/src/server/safs/cgi.c	Fri May 24 19:43:53 2024 +0200
+++ b/src/server/safs/cgi.c	Fri May 24 20:24:39 2024 +0200
@@ -571,7 +571,9 @@
     
     if(handler->result == REQ_ABORTED && handler->process.pid != 0) {
         log_ereport(LOG_FAILURE, "cgi-send: kill script: %s pid: %d", handler->path, (int)handler->process.pid);
-        killpg(handler->process.pid, SIGKILL);
+        if(killpg(handler->process.pid, SIGKILL)) {
+            log_ereport(LOG_FAILURE, "cgi-send: pid: %d kill failed: %s", (int)handler->process.pid, strerror(errno));
+        }
     }
     
     if(--handler->events > 0) {

mercurial