diff options
author | bde <bde@FreeBSD.org> | 1997-07-06 04:37:22 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-07-06 04:37:22 +0000 |
commit | f7ce8e6d2447e6b596f52faedb356f101b21a9f6 (patch) | |
tree | b46a9374ad3461047adb146431292d17fc9db974 /usr.bin | |
parent | a7e4624113034e193e5114313082f61ac9e53dff (diff) | |
download | FreeBSD-src-f7ce8e6d2447e6b596f52faedb356f101b21a9f6.zip FreeBSD-src-f7ce8e6d2447e6b596f52faedb356f101b21a9f6.tar.gz |
Merge from Lite2 (print "??" instead NULL if devname() fails). More
faithful stealing from pstat would have given this already.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/swap.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index ceb5f46..3c27e1c 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -32,7 +32,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)swap.c 8.2 (Berkeley) 2/21/94"; +#if 0 +static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -55,7 +59,6 @@ static char sccsid[] = "@(#)swap.c 8.2 (Berkeley) 2/21/94"; #include "systat.h" #include "extern.h" -extern char *devname __P((int, int)); extern char *getbsize __P((int *headerlenp, long *blocksizep)); void showspace __P((char *header, int hlen, long blocksize)); @@ -198,7 +201,7 @@ fetchswap() void labelswap() { - char *header; + char *header, *p; int row, i; row = 0; @@ -210,9 +213,10 @@ labelswap() for (i = 0; i < nswdev; i++) { if (!sw[i].sw_freed) continue; + p = devname(sw[i].sw_dev, S_IFBLK); mvwprintw(wnd, i + 1, 0, "%-5s", - sw[i].sw_dev != NODEV? - devname(sw[i].sw_dev, S_IFBLK): "[NFS]"); + sw[i].sw_dev == NODEV ? "[NFS]" : + p == NULL ? "??" : p); } } |