Make Proc_Kill() more fault-tolerant

This commit is contained in:
Alexander Barton 2010-07-11 16:54:44 +02:00
parent bf8b646304
commit 7b5e2fe38e
1 changed files with 4 additions and 3 deletions

View File

@ -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);
}