summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-11-25 22:12:28 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-11-25 22:12:28 +0000
commitbb2e9d47f3c7c8172836b589292612e5f155f054 (patch)
tree551b8f0c0328b4458a1ab9e9dad19adb0ab4ab4f /procps
parent5b110874dfa16dc41f31d8b34eef3d721573ca40 (diff)
downloadbusybox-w32-bb2e9d47f3c7c8172836b589292612e5f155f054.tar.gz
busybox-w32-bb2e9d47f3c7c8172836b589292612e5f155f054.tar.bz2
busybox-w32-bb2e9d47f3c7c8172836b589292612e5f155f054.zip
last_patch_67 from Vladimir N. Oleynik
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c18
-rw-r--r--procps/pidof.c7
2 files changed, 14 insertions, 11 deletions
diff --git a/procps/kill.c b/procps/kill.c
index cf5c412a8..9b31f28d6 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -132,15 +132,17 @@ do_it_now:
132 if (quiet==0) 132 if (quiet==0)
133 error_msg( "%s: no process killed", *argv); 133 error_msg( "%s: no process killed", *argv);
134 } else { 134 } else {
135 for(; *pidList!=0; pidList++) { 135 long *pl;
136 if (*pidList==myPid) 136
137 continue; 137 for(pl = pidList; *pl !=0 ; pl++) {
138 if (kill(*pidList, sig) != 0) { 138 if (*pl==myPid)
139 errors++; 139 continue;
140 if (quiet==0) 140 if (kill(*pl, sig) != 0) {
141 perror_msg( "Could not kill pid '%d'", *pidList); 141 errors++;
142 if (quiet==0)
143 perror_msg( "Could not kill pid '%d'", *pl);
144 }
142 } 145 }
143 }
144 } 146 }
145 free(pidList); 147 free(pidList);
146 argv++; 148 argv++;
diff --git a/procps/pidof.c b/procps/pidof.c
index 169a92007..8cd1a91c8 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -52,11 +52,12 @@ extern int pidof_main(int argc, char **argv)
52 52
53 /* Looks like everything is set to go. */ 53 /* Looks like everything is set to go. */
54 while(optind < argc) { 54 while(optind < argc) {
55 long* pidList; 55 long *pidList;
56 long *pl;
56 57
57 pidList = find_pid_by_name(argv[optind]); 58 pidList = find_pid_by_name(argv[optind]);
58 for(; *pidList > 0; pidList++) { 59 for(pl = pidList; *pl > 0; pl++) {
59 printf("%s%ld", (n++ ? " " : ""), (long)*pidList); 60 printf("%s%ld", (n++ ? " " : ""), *pl);
60 fail = 0; 61 fail = 0;
61 if (single_flag) 62 if (single_flag)
62 break; 63 break;