aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-17 01:12:41 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-17 01:12:41 +0000
commit6273f655c8e5a1b7233f94fd606ceaed95b9c7a7 (patch)
treead754ea972e52bb21db4323d916bacfb4f1c3f07 /procps
parent161220c4985b8c05a57f09b2693a6cad74d2e81d (diff)
downloadbusybox-6273f655c8e5a1b7233f94fd606ceaed95b9c7a7.tar.gz
Several fixes.
-Erik
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/procps/kill.c b/procps/kill.c
index 8a99e0f9e..10343a150 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -36,11 +36,12 @@ static const char *kill_usage =
"Send a signal (default is SIGTERM) to the specified process(es).\n\n"
"Options:\n" "\t-l\tList all signal names and numbers.\n\n";
+#ifdef BB_KILLALL
static const char *killall_usage =
"killall [-signal] process-name [process-name ...]\n\n"
"Send a signal (default is SIGTERM) to the specified process(es).\n\n"
"Options:\n" "\t-l\tList all signal names and numbers.\n\n";
-
+#endif
#define KILL 0
#define KILLALL 1
@@ -132,10 +133,15 @@ extern int kill_main(int argc, char **argv)
int whichApp, sig = SIGTERM;
const char *appUsage;
+#ifdef BB_KILLALL
/* Figure out what we are trying to do here */
whichApp = (strcmp(*argv, "killall") == 0)?
KILLALL : KILL;
appUsage = (whichApp == KILLALL)? killall_usage : kill_usage;
+#else
+ whichApp = KILL;
+ appUsage = kill_usage;
+#endif
argc--;
argv++;
@@ -213,7 +219,9 @@ extern int kill_main(int argc, char **argv)
fatalError( "Could not kill pid '%d': %s\n", pid, strerror(errno));
argv++;
}
- } else {
+ }
+#ifdef BB_KILLALL
+ else {
/* Looks like they want to do a killall. Do that */
while (--argc >= 0) {
int pid;
@@ -225,6 +233,7 @@ extern int kill_main(int argc, char **argv)
argv++;
}
}
+#endif
exit(TRUE);