about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2010-07-11 16:54:44 +0200
committerAlexander Barton <alex@barton.de>2010-07-11 16:54:44 +0200
commit7b5e2fe38e7af696155e687924462c4b9fe951bc (patch)
tree15bd44598d72913640b58ba07d7ae62aac52082a
parentbf8b64630443b2bd3fe2a298f860ea0d492df649 (diff)
downloadngircd-7b5e2fe38e7af696155e687924462c4b9fe951bc.tar.gz
ngircd-7b5e2fe38e7af696155e687924462c4b9fe951bc.zip
Make Proc_Kill() more fault-tolerant
-rw-r--r--src/ngircd/proc.c7
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);
 }