diff options
author | Ron Yorston <rmy@pobox.com> | 2024-05-14 12:33:03 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-05-14 12:33:03 +0100 |
commit | 569de936abb90f4c7cdca9da111a6ea780b135bf (patch) | |
tree | f1965765683e09ca780b39340abac90f349e47a4 /include | |
parent | bb128070e590234f8b63fb1d67f7621a1b4b3ff3 (diff) | |
download | busybox-w32-569de936abb90f4c7cdca9da111a6ea780b135bf.tar.gz busybox-w32-569de936abb90f4c7cdca9da111a6ea780b135bf.tar.bz2 busybox-w32-569de936abb90f4c7cdca9da111a6ea780b135bf.zip |
kill: killing a zombie process should fail
A process which has exited may still have its process handle
held open by its children. Such a process doesn't appear in
the process table. It is thus similar to a zombie process in
UNIX. Using kill(1) to interact with such a process was seen
to succeed, contrary to expectation.
The code for "ordinary" signals in kill(2) did check if the
process was still active but didn't treat an attempt to kill
an inactive process as an error. Furthermore, sending SIGKILL
or the fake signal 0 to a process didn't even check if the
process was still active.
Rearrange the implementation of kill(2) so that an attempt to
signal an inactive process is treated as an error. This also
consolidates handling of SIGKILL and signal 0 with "ordinary"
signals.
Saves 96 bytes.
(GitHub issue #416)
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h index 41d4cd940..56a7285e5 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -569,7 +569,6 @@ int mingw_execve(const char *cmd, char *const *argv, char *const *envp); | |||
569 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') | 569 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') |
570 | 570 | ||
571 | BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType); | 571 | BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType); |
572 | int kill_signal_by_handle(HANDLE process, int sig); | ||
573 | int FAST_FUNC is_valid_signal(int number); | 572 | int FAST_FUNC is_valid_signal(int number); |
574 | int exit_code_to_wait_status(DWORD win_exit_code); | 573 | int exit_code_to_wait_status(DWORD win_exit_code); |
575 | int exit_code_to_posix(DWORD win_exit_code); | 574 | int exit_code_to_posix(DWORD win_exit_code); |