about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/proc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c
index 7addb47e..e062cd0b 100644
--- a/src/ngircd/proc.c
+++ b/src/ngircd/proc.c
@@ -154,7 +154,10 @@ Proc_Read(PROC_STAT *proc, void *buffer, size_t buflen)
 GLOBAL void
 Proc_Close(PROC_STAT *proc)
 {
-	io_close(proc->pipe_fd);
+	/* Close socket, if it exists */
+	if (proc->pipe_fd >= 0)
+		io_close(proc->pipe_fd);
+
 	Proc_InitStruct(proc);
 }