summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-06-28 18:42:55 +0000
committerJay Freeman <saurik@saurik.com>2008-06-28 18:42:55 +0000
commit8c095268d381e98faef4d955c87ad8e5a3efdccd (patch)
treec75a19d044973e35357084bca330ac94b7e99b51
parent44a988d1e24b04a1def3e4f7570865e6b27e5c0e (diff)
Fixed killall on newer firmwares.
git-svn-id: http://svn.telesphoreo.org/trunk@339 514c082c-b64e-11dc-b46d-3d985efe055d
-rw-r--r--data/shell-cmds/procargs.diff31
1 files changed, 31 insertions, 0 deletions
diff --git a/data/shell-cmds/procargs.diff b/data/shell-cmds/procargs.diff
new file mode 100644
index 000000000..23e2a30b0
--- /dev/null
+++ b/data/shell-cmds/procargs.diff
@@ -0,0 +1,31 @@
+diff -ru shell_cmds-116/killall/killall.c shell_cmds-116+iPhone/killall/killall.c
+--- shell_cmds-116/killall/killall.c 2005-09-28 05:44:23.000000000 +0000
++++ shell_cmds-116+iPhone/killall/killall.c 2008-06-18 08:29:07.000000000 +0000
+@@ -345,7 +345,7 @@
+ continue;
+ thispid = procs[i].kp_proc.p_pid;
+
+- int mib[3], argmax;
++ int mib[3], argmax, nargs;
+ size_t syssize;
+ char *procargs, *cp;
+
+@@ -361,7 +361,7 @@
+ continue;
+
+ mib[0] = CTL_KERN;
+- mib[1] = KERN_PROCARGS;
++ mib[1] = KERN_PROCARGS2;
+ mib[2] = thispid;
+
+ syssize = (size_t)argmax;
+@@ -370,6 +370,9 @@
+ continue;
+ }
+
++ memcpy(&nargs, procargs, sizeof(nargs));
++ cp = procargs + sizeof(nargs);
++
+ for (cp = procargs; cp < &procargs[syssize]; cp++) {
+ if (*cp == '\0') {
+ break;