projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This is vodz' latest patch. Sorry it took so long...
[oweals/busybox.git]
/
renice.c
diff --git
a/renice.c
b/renice.c
index d79a64d1abe07c870e911e4df5311629b6a8d565..ec35bdcdeb1f7acd6483ea116825ef7508aab86b 100644
(file)
--- a/
renice.c
+++ b/
renice.c
@@
-20,18
+20,19
@@
*
*/
*
*/
-#include "busybox.h"
#include <stdio.h>
#include <errno.h>
#include <stdio.h>
#include <errno.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include "busybox.h"
extern int renice_main(int argc, char **argv)
{
extern int renice_main(int argc, char **argv)
{
- int prio,
err = 0
;
+ int prio,
status = EXIT_SUCCESS
;
- if (argc < 3)
usage(renice_usage
);
+ if (argc < 3)
show_usage(
);
prio = atoi(*++argv);
if (prio > 20) prio = 20;
prio = atoi(*++argv);
if (prio > 20) prio = 20;
@@
-44,10
+45,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 {
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;
+ perror_msg("%d: setpriority", ps);
+ status = EXIT_FAILURE;
}
}
}
}
- exit(err);
+
+ return status;
}
}