Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/renice Little cleanup:



details:   https://anonhg.NetBSD.org/src/rev/2a1f100db567
branches:  trunk
changeset: 514391:2a1f100db567
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Sep 01 01:57:28 2001 +0000

description:
Little cleanup:
 - Don't need to include <sys/time.h>, <sys/resource.h> does.
 - Include <limits.h> for LONG_MIN/LONG_MAX.
 - Be consistant with usage of (void) in front of printf()/fprintf().
 - Sort include files.
 - ANSIfy.

diffstat:

 usr.bin/renice/renice.c |  36 +++++++++++++++---------------------
 1 files changed, 15 insertions(+), 21 deletions(-)

diffs (91 lines):

diff -r 9c5451411d94 -r 2a1f100db567 usr.bin/renice/renice.c
--- a/usr.bin/renice/renice.c   Sat Sep 01 00:54:38 2001 +0000
+++ b/usr.bin/renice/renice.c   Sat Sep 01 01:57:28 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: renice.c,v 1.9 2001/02/19 23:03:50 cgd Exp $   */
+/*     $NetBSD: renice.c,v 1.10 2001/09/01 01:57:28 simonb Exp $       */
 
 /*
  * Copyright (c) 1983, 1989, 1993
@@ -41,25 +41,25 @@
 
 #ifndef lint
 /*static char sccsid[] = "from: @(#)renice.c   8.1 (Berkeley) 6/9/93";*/
-__RCSID("$NetBSD: renice.c,v 1.9 2001/02/19 23:03:50 cgd Exp $");
+__RCSID("$NetBSD: renice.c,v 1.10 2001/09/01 01:57:28 simonb Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
-#include <sys/time.h>
 #include <sys/resource.h>
 
 #include <err.h>
+#include <errno.h>
+#include <limits.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 
-static int     getnum __P((const char *, const char *, int *));
-static int     donice __P((int, int, int, int));
-static void    usage __P((void)) __attribute__((__noreturn__));
+static int     getnum(const char *, const char *, int *);
+static int     donice(int, int, int, int);
+static void    usage(void) __attribute__((__noreturn__));
 
-int    main __P((int, char **));
+int    main(int, char **);
 
 /*
  * Change the priority (nice) of processes
@@ -67,9 +67,7 @@
  * running.
  */
 int
-main(argc, argv)
-       int argc;
-       char **argv;
+main(int argc, char **argv)
 {
        int which = PRIO_PROCESS;
        int who = 0, prio, errs = 0, incr = 0;
@@ -121,9 +119,7 @@
 }
 
 static int
-getnum(com, str, val)
-       const char *com, *str;
-       int *val;
+getnum(const char *com, const char *str, int *val)
 {
        long v;
        char *ep;
@@ -144,8 +140,7 @@
 }
 
 static int
-donice(which, who, prio, incr)
-       int which, who, prio, incr;
+donice(int which, int who, int prio, int incr)
 {
        int oldprio;
 
@@ -172,12 +167,11 @@
 }
 
 static void
-usage()
+usage(void)
 {
 
-       (void)fprintf(stderr, "Usage: %s [<priority> | -n <incr>] ",
-           getprogname());
-       (void)fprintf(stderr, "[[-p] <pids>...] [-g <pgrp>...] ");
-       (void)fprintf(stderr, "[-u <user>...]\n");
+       fprintf(stderr, "Usage: %s [<priority> | -n <incr>] ", getprogname());
+       fprintf(stderr, "[[-p] <pids>...] [-g <pgrp>...] ");
+       fprintf(stderr, "[-u <user>...]\n");
        exit(1);
 }



Home | Main Index | Thread Index | Old Index