Skip to content

Commit 0ab0104

Browse files
committed
Merge pull request #6 from dscho/ctrl-c
When interrupting Win32 processes, kill their child processes, too
2 parents dde5c99 + 3c7a25e commit 0ab0104

File tree

8 files changed

+666
-7
lines changed

8 files changed

+666
-7
lines changed

winsup/cygwin/exceptions.cc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ details. */
2929
#include "exception.h"
3030
#include "posix_timer.h"
3131
#include "gcc_seh.h"
32+
#include "cygwin/exit_process.h"
3233

3334
/* Definitions for code simplification */
3435
#ifdef __x86_64__
@@ -1550,8 +1551,23 @@ sigpacket::process ()
15501551
dosig:
15511552
if (have_execed)
15521553
{
1553-
sigproc_printf ("terminating captive process");
1554-
TerminateProcess (ch_spawn, sigExeced = si.si_signo);
1554+
switch (si.si_signo)
1555+
{
1556+
case SIGUSR1:
1557+
case SIGUSR2:
1558+
case SIGCONT:
1559+
case SIGSTOP:
1560+
case SIGTSTP:
1561+
case SIGTTIN:
1562+
case SIGTTOU:
1563+
system_printf ("Suppressing signal %d to win32 process (pid %u)",
1564+
(int)si.si_signo, (unsigned int)GetProcessId(ch_spawn));
1565+
goto done;
1566+
default:
1567+
sigproc_printf ("terminating captive process");
1568+
rc = exit_process_tree (ch_spawn, 128 + (sigExeced = si.si_signo));
1569+
goto done;
1570+
}
15551571
}
15561572
/* Dispatch to the appropriate function. */
15571573
sigproc_printf ("signal %d, signal handler %p", si.si_signo, handler);

0 commit comments

Comments
 (0)