Skip to content

Commit 7e9b8b9

Browse files
committed
Merge pull request #6 from dscho/ctrl-c
When interrupting Win32 processes, kill their child processes, too
2 parents 612dfe0 + 3f3b93e commit 7e9b8b9

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
@@ -28,6 +28,7 @@ details. */
2828
#include "ntdll.h"
2929
#include "exception.h"
3030
#include "posix_timer.h"
31+
#include "cygwin/exit_process.h"
3132

3233
/* Definitions for code simplification */
3334
#ifdef __x86_64__
@@ -1545,8 +1546,23 @@ sigpacket::process ()
15451546
dosig:
15461547
if (have_execed)
15471548
{
1548-
sigproc_printf ("terminating captive process");
1549-
TerminateProcess (ch_spawn, sigExeced = si.si_signo);
1549+
switch (si.si_signo)
1550+
{
1551+
case SIGUSR1:
1552+
case SIGUSR2:
1553+
case SIGCONT:
1554+
case SIGSTOP:
1555+
case SIGTSTP:
1556+
case SIGTTIN:
1557+
case SIGTTOU:
1558+
system_printf ("Suppressing signal %d to win32 process (pid %u)",
1559+
(int)si.si_signo, (unsigned int)GetProcessId(ch_spawn));
1560+
goto done;
1561+
default:
1562+
sigproc_printf ("terminating captive process");
1563+
rc = exit_process_tree (ch_spawn, 128 + (sigExeced = si.si_signo));
1564+
goto done;
1565+
}
15501566
}
15511567
/* Dispatch to the appropriate function. */
15521568
sigproc_printf ("signal %d, signal handler %p", si.si_signo, handler);

0 commit comments

Comments
 (0)