We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3b1997 commit 090c14bCopy full SHA for 090c14b
contrib/win32/win32compat/signal.c
@@ -158,12 +158,21 @@ sw_raise(int sig) {
158
159
int
160
sw_kill(int pid, int sig) {
161
-
+ int child_index, i;
162
if (pid == GetCurrentProcessId())
163
return sw_raise(sig);
164
165
/* for child processes - only SIGTERM supported*/
166
/* TODO implement kill(SIGTERM) for child processes */
167
+ child_index = -1;
168
+ for (i = 0; i < children.num_children; i++)
169
+ if (children.process_id[i] == pid) {
170
+ child_index = i;
171
+ break;
172
+ }
173
+
174
+ if (child_index != -1)
175
+ TerminateProcess(children.handles[child_index], 0);
176
return 0;
177
}
178
0 commit comments