summaryrefslogtreecommitdiff
path: root/data/shell-cmds/procargs.diff
blob: 23e2a30b0b8bea12571e0e8e4577de84faad75a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;