last_patch_67 from Vladimir N. Oleynik
authorGlenn L McGrath <bug1@ihug.co.nz>
Mon, 25 Nov 2002 22:12:28 +0000 (22:12 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Mon, 25 Nov 2002 22:12:28 +0000 (22:12 -0000)
procps/kill.c
procps/pidof.c

index cf5c412a8a16e7d7bb4569fb67ca4a426a865798..9b31f28d6497af0051dc187cfd78e16bb82b0218 100644 (file)
@@ -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++;
index 169a92007ea3f867ad4aa8a1de0e1de334a89db5..8cd1a91c86f151fb6da2784aa4936a914078a6f9 100644 (file)
@@ -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;