From 7b5e2fe38e7af696155e687924462c4b9fe951bc Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 11 Jul 2010 16:54:44 +0200 Subject: [PATCH] Make Proc_Kill() more fault-tolerant --- src/ngircd/proc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c index 75c1aaf1..3eb3d804 100644 --- a/src/ngircd/proc.c +++ b/src/ngircd/proc.c @@ -93,10 +93,11 @@ GLOBAL void Proc_Kill(PROC_STAT *proc) { assert(proc != NULL); - assert(proc->pipe_fd >= 0); - io_close(proc->pipe_fd); - kill(proc->pid, SIGTERM); + if (proc->pipe_fd > 0) + io_close(proc->pipe_fd); + if (proc->pid > 0) + kill(proc->pid, SIGTERM); Proc_InitStruct(proc); } -- 2.39.2