diff options
author | maxim <maxim@FreeBSD.org> | 2002-04-10 10:59:19 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2002-04-10 10:59:19 +0000 |
commit | 7b6414ec32f8750ea22f3a5e9839b0226358c3ba (patch) | |
tree | 61383f9bd89c78e11840e62b4b56f21cab20de3d /usr.bin/renice | |
parent | 04f18ad12cd35050f55d9c510670c77e6352646d (diff) | |
download | FreeBSD-src-7b6414ec32f8750ea22f3a5e9839b0226358c3ba.zip FreeBSD-src-7b6414ec32f8750ea22f3a5e9839b0226358c3ba.tar.gz |
style(9) cleanup.
Reviewed by: bde
MFC after: 1 week
Diffstat (limited to 'usr.bin/renice')
-rw-r--r-- | usr.bin/renice/renice.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c index a2822b3..de6bcf3 100644 --- a/usr.bin/renice/renice.c +++ b/usr.bin/renice/renice.c @@ -51,13 +51,13 @@ static const char rcsid[] = #include <err.h> #include <errno.h> +#include <pwd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <pwd.h> -int donice(int, int, int); -static void usage(void); +static int donice(int, int, int); +static void usage(void); /* * Change the priority (nice) of processes @@ -65,13 +65,14 @@ static void usage(void); * running. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { - int which = PRIO_PROCESS; - int who = 0, prio, errs = 0; + struct passwd *pwd; + int errs, prio, which, who; + errs = 0; + which = PRIO_PROCESS; + who = 0; argc--, argv++; if (argc < 2) usage(); @@ -95,8 +96,7 @@ main(argc, argv) continue; } if (which == PRIO_USER) { - register struct passwd *pwd = getpwnam(*argv); - + pwd = getpwnam(*argv); if (pwd == NULL) { warnx("%s: unknown user", *argv); continue; @@ -114,21 +114,13 @@ main(argc, argv) exit(errs != 0); } -static void -usage() -{ - fprintf(stderr, -"usage: renice priority [ [ -p ] pids ] [ [ -g ] pgrps ] [ [ -u ] users ]\n"); - exit(1); -} - -int -donice(which, who, prio) - int which, who, prio; +static int +donice(int which, int who, int prio) { int oldprio; - errno = 0, oldprio = getpriority(which, who); + errno = 0; + oldprio = getpriority(which, who); if (oldprio == -1 && errno) { warn("%d: getpriority", who); return (1); @@ -140,3 +132,11 @@ donice(which, who, prio) printf("%d: old priority %d, new priority %d\n", who, oldprio, prio); return (0); } + +static void +usage() +{ + fprintf(stderr, +"usage: renice priority [ [ -p ] pids ] [ [ -g ] pgrps ] [ [ -u ] users ]\n"); + exit(1); +} |