aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-05-14 12:33:03 +0100
committerRon Yorston <rmy@pobox.com>2024-05-14 12:33:03 +0100
commit569de936abb90f4c7cdca9da111a6ea780b135bf (patch)
treef1965765683e09ca780b39340abac90f349e47a4 /include
parentbb128070e590234f8b63fb1d67f7621a1b4b3ff3 (diff)
downloadbusybox-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.h1
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
571BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType); 571BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType);
572int kill_signal_by_handle(HANDLE process, int sig);
573int FAST_FUNC is_valid_signal(int number); 572int FAST_FUNC is_valid_signal(int number);
574int exit_code_to_wait_status(DWORD win_exit_code); 573int exit_code_to_wait_status(DWORD win_exit_code);
575int exit_code_to_posix(DWORD win_exit_code); 574int exit_code_to_posix(DWORD win_exit_code);