aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-05-06 22:48:55 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-05-06 22:48:55 +0000
commit02f47e9f8140e5b4e83f691df21a542f0651ab15 (patch)
tree4965e1bfef019fb2587bee2154c3605b501a5a02
parent21f0d4c55eceaf24f4f7e2b679032c55a104f1ac (diff)
downloadbusybox-w32-02f47e9f8140e5b4e83f691df21a542f0651ab15.tar.gz
busybox-w32-02f47e9f8140e5b4e83f691df21a542f0651ab15.tar.bz2
busybox-w32-02f47e9f8140e5b4e83f691df21a542f0651ab15.zip
kill: fix recent breakage of vda, also make code smaller by 21 bytes.
-rw-r--r--procps/kill.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/procps/kill.c b/procps/kill.c
index b3257492d..3ccbd30e4 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini kill/killall implementation for busybox 3 * Mini kill/killall[5] implementation for busybox
4 * 4 *
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
@@ -30,10 +30,17 @@ int kill_main(int argc, char **argv)
30 char *arg; 30 char *arg;
31 pid_t pid; 31 pid_t pid;
32 int signo = SIGTERM, errors = 0, quiet = 0; 32 int signo = SIGTERM, errors = 0, quiet = 0;
33 const int killall = (ENABLE_KILLALL && argv[0][4] == 'a' 33#if !ENABLE_KILLALL && !ENABLE_KILLALL5
34 && (!ENABLE_KILLALL5 || argv[0][7] != '5')); 34#define killall 0
35 const int killall5 = (ENABLE_KILLALL5 && argv[0][4] == 'a' 35#define killall5 0
36 && (!ENABLE_KILLALL || argv[0][7] == '5')); 36#else
37/* How to determine who we are? find 3rd char from the end:
38 * kill, killall, killall5
39 * ^i ^a ^l */
40 const char char3 = argv[0][strlen(argv[0]) - 3];
41#define killall (ENABLE_KILLALL && char3 == 'a')
42#define killall5 (ENABLE_KILLALL5 && char3 == 'l')
43#endif
37 44
38 /* Parse any options */ 45 /* Parse any options */
39 argc--; 46 argc--;