diff options
author | Ron Yorston <rmy@pobox.com> | 2023-05-23 10:57:56 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-05-23 10:57:56 +0100 |
commit | 20b6a57af64506a4152b145b031aad2946a37ca8 (patch) | |
tree | c92e38c5e72e1b7ac36845a15967d6f4fe60c8f7 /include | |
parent | 89aa9d783c535670c6aed1d32c8740b7474cca00 (diff) | |
download | busybox-w32-20b6a57af64506a4152b145b031aad2946a37ca8.tar.gz busybox-w32-20b6a57af64506a4152b145b031aad2946a37ca8.tar.bz2 busybox-w32-20b6a57af64506a4152b145b031aad2946a37ca8.zip |
win32: crtl-c interrupts non-console applications
Commit 9db9b34ad (win32: ignore ctrl-c in parent of execve(2))
prevented a parent process from reacting to Ctrl-C while it was
waiting for its child to complete. This avoids the problem where
a shell and an interactive child end up competing for input after
a Ctrl-C.
However, a child process which isn't attached to the console
(a GUI application, for example) can't then be killed by Ctrl-C.
Instead of completely ignoring Ctrl-C give the parent a handler
which detects if its child is attached to the console. If so it's
left to handle Ctrl-C itself and the parent ignores the interrupt.
If not the parent terminates the child and all its children as if
by SIGINT.
Costs 200 bytes.
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index f94804d91..13adf9017 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -540,6 +540,7 @@ int mingw_execve(const char *cmd, char *const *argv, char *const *envp); | |||
540 | 540 | ||
541 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') | 541 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') |
542 | 542 | ||
543 | BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType); | ||
543 | int kill_signal_by_handle(HANDLE process, int sig); | 544 | int kill_signal_by_handle(HANDLE process, int sig); |
544 | int FAST_FUNC is_valid_signal(int number); | 545 | int FAST_FUNC is_valid_signal(int number); |
545 | 546 | ||