diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-26 01:12:28 +0300 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-26 01:12:28 +0300 |
commit | bb2e9d47f3c7c8172836b589292612e5f155f054 (patch) | |
tree | 551b8f0c0328b4458a1ab9e9dad19adb0ab4ab4f /procps | |
parent | 5b110874dfa16dc41f31d8b34eef3d721573ca40 (diff) |
last_patch_67 from Vladimir N. Oleynik
Diffstat (limited to 'procps')
-rw-r--r-- | procps/kill.c | 18 | ||||
-rw-r--r-- | procps/pidof.c | 7 |
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: if (quiet==0) error_msg( "%s: no process killed", *argv); } else { - for(; *pidList!=0; pidList++) { - if (*pidList==myPid) - continue; - if (kill(*pidList, sig) != 0) { - errors++; - if (quiet==0) - perror_msg( "Could not kill pid '%d'", *pidList); + long *pl; + + for(pl = pidList; *pl !=0 ; pl++) { + if (*pl==myPid) + continue; + if (kill(*pl, sig) != 0) { + errors++; + if (quiet==0) + perror_msg( "Could not kill pid '%d'", *pl); + } } - } } free(pidList); 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) /* Looks like everything is set to go. */ while(optind < argc) { - long* pidList; + long *pidList; + long *pl; pidList = find_pid_by_name(argv[optind]); - for(; *pidList > 0; pidList++) { - printf("%s%ld", (n++ ? " " : ""), (long)*pidList); + for(pl = pidList; *pl > 0; pl++) { + printf("%s%ld", (n++ ? " " : ""), *pl); fail = 0; if (single_flag) break; |