summaryrefslogtreecommitdiff
path: root/openwrt/package/busybox/patches/100-killall5.patch
diff options
context:
space:
mode:
authormbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-02-06 01:32:23 +0000
committermbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-02-06 01:32:23 +0000
commit4d71a0805ae4e1e69596b1fb0682ec184d8af290 (patch)
tree1edd3aafd4f33d4c40a29afc49532a6c4564d954 /openwrt/package/busybox/patches/100-killall5.patch
parent6516b8e39a52b3df85edc753aeb3bfe45ab8b66e (diff)
*** empty log message ***
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@213 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/busybox/patches/100-killall5.patch')
-rw-r--r--openwrt/package/busybox/patches/100-killall5.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/openwrt/package/busybox/patches/100-killall5.patch b/openwrt/package/busybox/patches/100-killall5.patch
new file mode 100644
index 0000000000..161b7e6f25
--- /dev/null
+++ b/openwrt/package/busybox/patches/100-killall5.patch
@@ -0,0 +1,87 @@
+diff -urN busybox-dist/include/applets.h busybox/include/applets.h
+--- busybox-dist/include/applets.h 2004-03-13 02:33:09.000000000 -0600
++++ busybox/include/applets.h 2004-03-16 09:45:29.000000000 -0600
+@@ -313,6 +313,9 @@
+ #ifdef CONFIG_KILLALL
+ APPLET(killall, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
+ #endif
++#ifdef CONFIG_KILLALL5
++ APPLET(killall5, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
++#endif
+ #ifdef CONFIG_KLOGD
+ APPLET(klogd, klogd_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
+ #endif
+diff -urN busybox-dist/include/usage.h busybox/include/usage.h
+--- busybox-dist/include/usage.h 2004-03-13 02:33:09.000000000 -0600
++++ busybox/include/usage.h 2004-03-16 09:45:29.000000000 -0600
+@@ -1389,6 +1389,13 @@
+ #define killall_example_usage \
+ "$ killall apache\n"
+
++#define killall5_trivial_usage \
++ ""
++#define killall5_full_usage \
++ ""
++#define killall5_example_usage \
++ ""
++
+ #define klogd_trivial_usage \
+ "[-c n] [-n]"
+ #define klogd_full_usage \
+diff -urN busybox-dist/procps/Config.in busybox/procps/Config.in
+--- busybox-dist/procps/Config.in 2003-12-24 00:02:11.000000000 -0600
++++ busybox/procps/Config.in 2004-03-16 09:45:29.000000000 -0600
+@@ -30,6 +30,11 @@
+ specified commands. If no signal name is specified, SIGTERM is
+ sent.
+
++config CONFIG_KILLALL5
++ bool "killall5"
++ default n
++ depends on CONFIG_KILL
++
+ config CONFIG_PIDOF
+ bool "pidof"
+ default n
+diff -urN busybox-dist/procps/kill.c busybox/procps/kill.c
+--- busybox-dist/procps/kill.c 2004-03-15 02:29:03.000000000 -0600
++++ busybox/procps/kill.c 2004-03-16 09:45:29.000000000 -0600
+@@ -34,6 +34,7 @@
+
+ #define KILL 0
+ #define KILLALL 1
++#define KILLALL5 2
+
+ extern int kill_main(int argc, char **argv)
+ {
+@@ -47,6 +48,9 @@
+ #else
+ whichApp = KILL;
+ #endif
++#ifdef CONFIG_KILLALL5
++ whichApp = (strcmp(bb_applet_name, "killall5") == 0)? KILLALL5 : whichApp;
++#endif
+
+ /* Parse any options */
+ if (argc < 2)
+@@ -119,6 +123,20 @@
+ }
+
+ }
++#ifdef CONFIG_KILLALL5
++ else if (whichApp == KILLALL5) {
++ procps_status_t * p;
++ pid_t myPid=getpid();
++ while ((p = procps_scan(0)) != 0) {
++ if (p->pid != 1 && p->pid != myPid && p->pid != p->ppid) {
++ if (kill(p->pid, signo) != 0) {
++ bb_perror_msg( "Could not kill pid '%d'", p->pid);
++ errors++;
++ }
++ }
++ }
++ }
++#endif
+ #ifdef CONFIG_KILLALL
+ else {
+ pid_t myPid=getpid();