Use perrorMsg and clean up exit status.
authorMatt Kraai <kraai@debian.org>
Tue, 5 Dec 2000 20:07:27 +0000 (20:07 -0000)
committerMatt Kraai <kraai@debian.org>
Tue, 5 Dec 2000 20:07:27 +0000 (20:07 -0000)
procps/renice.c
renice.c

index d79a64d1abe07c870e911e4df5311629b6a8d565..c81f31c5c91bb459c4882a67c8c879fe61920259 100644 (file)
@@ -29,7 +29,7 @@
 
 extern int renice_main(int argc, char **argv)
 {
-       int prio, err = 0;
+       int prio, status = EXIT_SUCCESS;
        
        if (argc < 3)   usage(renice_usage);
                
@@ -44,10 +44,10 @@ extern int renice_main(int argc, char **argv)
                if (setpriority(PRIO_PROCESS, ps, prio) == 0) {
                        printf("%d: old priority %d, new priority %d\n", ps, oldp, prio );
                } else {
-                       fprintf(stderr, "renice: %d: setpriority: ", ps);
-                       perror("");
-                       err = 1;
+                       perrorMsg("%d: setpriority", ps);
+                       status = EXIT_FAILURE;
                }
        }
-       exit(err);
+
+       return status;
 }
index d79a64d1abe07c870e911e4df5311629b6a8d565..c81f31c5c91bb459c4882a67c8c879fe61920259 100644 (file)
--- a/renice.c
+++ b/renice.c
@@ -29,7 +29,7 @@
 
 extern int renice_main(int argc, char **argv)
 {
-       int prio, err = 0;
+       int prio, status = EXIT_SUCCESS;
        
        if (argc < 3)   usage(renice_usage);
                
@@ -44,10 +44,10 @@ extern int renice_main(int argc, char **argv)
                if (setpriority(PRIO_PROCESS, ps, prio) == 0) {
                        printf("%d: old priority %d, new priority %d\n", ps, oldp, prio );
                } else {
-                       fprintf(stderr, "renice: %d: setpriority: ", ps);
-                       perror("");
-                       err = 1;
+                       perrorMsg("%d: setpriority", ps);
+                       status = EXIT_FAILURE;
                }
        }
-       exit(err);
+
+       return status;
 }