last_patch_67 from Vladimir N. Oleynik
This commit is contained in:
@ -132,13 +132,15 @@ do_it_now:
|
|||||||
if (quiet==0)
|
if (quiet==0)
|
||||||
error_msg( "%s: no process killed", *argv);
|
error_msg( "%s: no process killed", *argv);
|
||||||
} else {
|
} else {
|
||||||
for(; *pidList!=0; pidList++) {
|
long *pl;
|
||||||
if (*pidList==myPid)
|
|
||||||
|
for(pl = pidList; *pl !=0 ; pl++) {
|
||||||
|
if (*pl==myPid)
|
||||||
continue;
|
continue;
|
||||||
if (kill(*pidList, sig) != 0) {
|
if (kill(*pl, sig) != 0) {
|
||||||
errors++;
|
errors++;
|
||||||
if (quiet==0)
|
if (quiet==0)
|
||||||
perror_msg( "Could not kill pid '%d'", *pidList);
|
perror_msg( "Could not kill pid '%d'", *pl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,11 @@ extern int pidof_main(int argc, char **argv)
|
|||||||
/* Looks like everything is set to go. */
|
/* Looks like everything is set to go. */
|
||||||
while(optind < argc) {
|
while(optind < argc) {
|
||||||
long *pidList;
|
long *pidList;
|
||||||
|
long *pl;
|
||||||
|
|
||||||
pidList = find_pid_by_name(argv[optind]);
|
pidList = find_pid_by_name(argv[optind]);
|
||||||
for(; *pidList > 0; pidList++) {
|
for(pl = pidList; *pl > 0; pl++) {
|
||||||
printf("%s%ld", (n++ ? " " : ""), (long)*pidList);
|
printf("%s%ld", (n++ ? " " : ""), *pl);
|
||||||
fail = 0;
|
fail = 0;
|
||||||
if (single_flag)
|
if (single_flag)
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user