Skip to content

Commit

Permalink
fixup! mingw: kill unterminated child processes on signals
Browse files Browse the repository at this point in the history
Let's be careful not to close a handle that has been closed already...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed May 24, 2017
1 parent fe31e2c commit abd867d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,9 @@ static void kill_child_processes_on_signal(void)
while (pinfo) {
struct pinfo_t *info = pinfo;
pinfo = pinfo->next;
exit_process(info->proc, status);
CloseHandle(info->proc);
if (exit_process(info->proc, status))
/* the handle is still valid in case of error */
CloseHandle(info->proc);
free(info);
}

Expand Down

0 comments on commit abd867d

Please sign in to comment.