mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-25 23:14:54 +02:00
kill() child processes
This commit is contained in:
parent
e3b1997252
commit
090c14b6e3
@ -158,12 +158,21 @@ sw_raise(int sig) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
sw_kill(int pid, int sig) {
|
sw_kill(int pid, int sig) {
|
||||||
|
int child_index, i;
|
||||||
if (pid == GetCurrentProcessId())
|
if (pid == GetCurrentProcessId())
|
||||||
return sw_raise(sig);
|
return sw_raise(sig);
|
||||||
|
|
||||||
/* for child processes - only SIGTERM supported*/
|
/* for child processes - only SIGTERM supported*/
|
||||||
/* TODO implement kill(SIGTERM) for child processes */
|
/* TODO implement kill(SIGTERM) for child processes */
|
||||||
|
child_index = -1;
|
||||||
|
for (i = 0; i < children.num_children; i++)
|
||||||
|
if (children.process_id[i] == pid) {
|
||||||
|
child_index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child_index != -1)
|
||||||
|
TerminateProcess(children.handles[child_index], 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user