diff options
| author | Alexander Barton <alex@barton.de> | 2010-07-11 16:54:44 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2010-07-11 16:54:44 +0200 |
| commit | 7b5e2fe38e7af696155e687924462c4b9fe951bc (patch) | |
| tree | 15bd44598d72913640b58ba07d7ae62aac52082a /src | |
| parent | bf8b64630443b2bd3fe2a298f860ea0d492df649 (diff) | |
| download | ngircd-7b5e2fe38e7af696155e687924462c4b9fe951bc.tar.gz ngircd-7b5e2fe38e7af696155e687924462c4b9fe951bc.zip | |
Make Proc_Kill() more fault-tolerant
Diffstat (limited to 'src')
| -rw-r--r-- | 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 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); } |