mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-24 01:04:09 +00:00
Make Proc_Kill() more fault-tolerant
This commit is contained in:
parent
bf8b646304
commit
7b5e2fe38e
@ -93,10 +93,11 @@ GLOBAL void
|
|||||||
Proc_Kill(PROC_STAT *proc)
|
Proc_Kill(PROC_STAT *proc)
|
||||||
{
|
{
|
||||||
assert(proc != NULL);
|
assert(proc != NULL);
|
||||||
assert(proc->pipe_fd >= 0);
|
|
||||||
|
|
||||||
io_close(proc->pipe_fd);
|
if (proc->pipe_fd > 0)
|
||||||
kill(proc->pid, SIGTERM);
|
io_close(proc->pipe_fd);
|
||||||
|
if (proc->pid > 0)
|
||||||
|
kill(proc->pid, SIGTERM);
|
||||||
Proc_InitStruct(proc);
|
Proc_InitStruct(proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user