use err/warn from C library
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 04:17:52 +0000 (20:17 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 04:17:52 +0000 (20:17 -0800)
SCCS-vsn: bin/ps/nlist.c 5.8

usr/src/bin/ps/nlist.c

index 623091f..59d01a0 100644 (file)
@@ -6,18 +6,21 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)nlist.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/proc.h>
 #include <sys/resource.h>
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/proc.h>
 #include <sys/resource.h>
-#include <nlist.h>
+
+#include <err.h>
 #include <errno.h>
 #include <errno.h>
+#include <kvm.h>
+#include <nlist.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdio.h>
 #include <string.h>
-#include <kvm.h>
+
 #include "ps.h"
 
 #ifdef SPPWAIT
 #include "ps.h"
 
 #ifdef SPPWAIT
@@ -65,33 +68,33 @@ donlist()
        if (kvm_nlist(kd, psnl)) {
                nlisterr(psnl);
                eval = 1;
        if (kvm_nlist(kd, psnl)) {
                nlisterr(psnl);
                eval = 1;
-               return(1);
+               return (1);
        }
        if (kread(X_FSCALE, fscale)) {
        }
        if (kread(X_FSCALE, fscale)) {
-               (void)fprintf(stderr, "ps: fscale: %s\n", kvm_geterr(kd));
+               warnx("fscale: %s", kvm_geterr(kd));
                eval = rval = 1;
        }
 #ifdef NEWVM
        if (kread(X_AVAILEND, mempages)) {
                eval = rval = 1;
        }
 #ifdef NEWVM
        if (kread(X_AVAILEND, mempages)) {
-               (void)fprintf(stderr, "ps: avail_start: %s\n", kvm_geterr(kd));
+               warnx("avail_start: %s", kvm_geterr(kd));
                eval = rval = 1;
        }
        if (kread(X_AVAILSTART, tmp)) {
                eval = rval = 1;
        }
        if (kread(X_AVAILSTART, tmp)) {
-               (void)fprintf(stderr, "ps: avail_end: %s\n", kvm_geterr(kd));
+               warnx("avail_end: %s", kvm_geterr(kd));
                eval = rval = 1;
        }
        mempages -= tmp;
 #else
        if (kread(X_ECMX, mempages)) {
                eval = rval = 1;
        }
        mempages -= tmp;
 #else
        if (kread(X_ECMX, mempages)) {
-               (void)fprintf(stderr, "ps: ecmx: %s\n", kvm_geterr(kd));
+               warnx("ecmx: %s", kvm_geterr(kd));
                eval = rval = 1;
        }
 #endif
        if (kread(X_CCPU, ccpu)) {
                eval = rval = 1;
        }
 #endif
        if (kread(X_CCPU, ccpu)) {
-               (void)fprintf(stderr, "ps: ccpu: %s\n", kvm_geterr(kd));
+               warnx("ccpu: %s", kvm_geterr(kd));
                eval = rval = 1;
        }
                eval = rval = 1;
        }
-       return(rval);
+       return (rval);
 }
 
 void
 }
 
 void