Skip to content

Commit

Permalink
Refuse to send job control signals to Win32 processes
Browse files Browse the repository at this point in the history
When calling Win32 processes from MSYS2, it does not really make sense
to kill them when a user tries to suspend them. It is much better to
warn the user that Win32 processes simply cannot be suspended.

This closes git-for-windows/git#1083 and
replaces git-for-windows/build-extra#154

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 7, 2017
1 parent 6b60ce5 commit 65e334c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions winsup/cygwin/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,23 @@ sigpacket::process ()
dosig:
if (have_execed)
{
sigproc_printf ("terminating captive process");
exit_process (ch_spawn, 128 + (sigExeced = si.si_signo));
switch (si.si_signo)
{
case SIGUSR1:
case SIGUSR2:
case SIGCONT:
case SIGSTOP:
case SIGTSTP:
case SIGTTIN:
case SIGTTOU:
system_printf ("Suppressing signal %d to win32 process (pid %u)",
(int)si.si_signo, (unsigned int)GetProcessId(ch_spawn));
goto done;
default:
sigproc_printf ("terminating captive process");
exit_process (ch_spawn, 128 + (sigExeced = si.si_signo));
break;
}
}
/* Dispatch to the appropriate function. */
sigproc_printf ("signal %d, signal handler %p", si.si_signo, handler);
Expand Down

0 comments on commit 65e334c

Please sign in to comment.