Skip to content

Commit abd867d

Browse files
committed
fixup! mingw: kill unterminated child processes on signals
Let's be careful not to close a handle that has been closed already... Signed-off-by: Johannes Schindelin <[email protected]>
1 parent fe31e2c commit abd867d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compat/mingw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,9 @@ static void kill_child_processes_on_signal(void)
15231523
while (pinfo) {
15241524
struct pinfo_t *info = pinfo;
15251525
pinfo = pinfo->next;
1526-
exit_process(info->proc, status);
1527-
CloseHandle(info->proc);
1526+
if (exit_process(info->proc, status))
1527+
/* the handle is still valid in case of error */
1528+
CloseHandle(info->proc);
15281529
free(info);
15291530
}
15301531

0 commit comments

Comments
 (0)