diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-06 22:48:55 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-06 22:48:55 +0000 |
commit | 1a2df109473271c5f65c34345d26a466a4827f09 (patch) | |
tree | 4965e1bfef019fb2587bee2154c3605b501a5a02 | |
parent | a7be2b029291ab2c419d425406024167eb700990 (diff) | |
download | busybox-w32-1a2df109473271c5f65c34345d26a466a4827f09.tar.gz busybox-w32-1a2df109473271c5f65c34345d26a466a4827f09.tar.bz2 busybox-w32-1a2df109473271c5f65c34345d26a466a4827f09.zip |
kill: fix recent breakage of vda, also make code smaller by 21 bytes.
git-svn-id: svn://busybox.net/trunk/busybox@18567 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | procps/kill.c | 17 |
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--; |