Module: ngircd.git Branch: master Commit: 7b5e2fe38e7af696155e687924462c4b9fe951bc URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=7b5e2...
Author: Alexander Barton alex@barton.de Date: Sun Jul 11 16:54:44 2010 +0200
Make Proc_Kill() more fault-tolerant
---
src/ngircd/proc.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c index 75c1aaf..3eb3d80 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); }
ngircd-commits@lists.barton.de