about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);
 }