From: Alexander Barton Date: Sun, 11 Jul 2010 14:54:44 +0000 (+0200) Subject: Make Proc_Kill() more fault-tolerant X-Git-Tag: rel-17-rc1~73 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=7b5e2fe38e7af696155e687924462c4b9fe951bc;p=ngircd.git Make Proc_Kill() more fault-tolerant --- 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); }