Make killall and killall5 selecatable independent from kill

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-11-23 06:43:46 +01:00
parent f8f81ed7aa
commit 5467d268f0

View File

@ -18,7 +18,6 @@
//config:config KILLALL
//config: bool "killall"
//config: default y
//config: depends on KILL
//config: help
//config: killall sends a signal to all processes running any of the
//config: specified commands. If no signal name is specified, SIGTERM is
@ -27,8 +26,11 @@
//config:config KILLALL5
//config: bool "killall5"
//config: default y
//config: depends on KILL
//config:
//config: help
//config: The SystemV killall command. killall5 sends a signal
//config: to all processes except kernel threads and the processes
//config: in its own session, so it won't kill the shell that is running
//config: the script it was called from.
//applet:IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP))
//applet:IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall))
@ -95,9 +97,15 @@ int kill_main(int argc UNUSED_PARAM, char **argv)
char *arg;
pid_t pid;
int signo = SIGTERM, errors = 0, quiet = 0;
#if !ENABLE_KILLALL && !ENABLE_KILLALL5
#if ENABLE_KILL && !ENABLE_KILLALL && !ENABLE_KILLALL5
# define killall 0
# define killall5 0
#elif !ENABLE_KILL && ENABLE_KILLALL && !ENABLE_KILLALL5
# define killall 1
# define killall5 0
#elif !ENABLE_KILL && !ENABLE_KILLALL && ENABLE_KILLALL5
# define killall 0
# define killall5 1
#else
/* How to determine who we are? find 3rd char from the end:
* kill, killall, killall5