Code

Fix kill_io() to only call kill(2) when pid is non-zero
authorJonas Fonseca <fonseca@diku.dk>
Fri, 23 Jan 2009 17:12:25 +0000 (18:12 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Fri, 23 Jan 2009 17:12:25 +0000 (18:12 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 010efc547832c208621b1e73ba6776e2649b092f..9e80d15b7fb61bd886a648f1387a0dd1828cb1ff 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -368,7 +368,7 @@ io_open(struct io *io, const char *name)
 static bool
 kill_io(struct io *io)
 {
-       return kill(io->pid, SIGKILL) != -1;
+       return io->pid == 0 || kill(io->pid, SIGKILL) != -1;
 }
 
 static bool