diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-25 21:11:53 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-25 21:11:53 +0000 |
commit | 4f54cf8a751208393591bfd0e056d817301116b4 (patch) | |
tree | 0d8c6b60811fde138c1300666cf38e704cc77b49 /usr.sbin/pstat/pstat.c | |
parent | d8d893a3e1d0d9d6fcb4e970db6d53c331949254 (diff) |
Handle syncer vnodes gracefully, okay deraadt@
Diffstat (limited to 'usr.sbin/pstat/pstat.c')
-rw-r--r-- | usr.sbin/pstat/pstat.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index ce6f1ca74d8..0ae8c80539f 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pstat.c,v 1.56 2005/12/28 20:48:18 pedro Exp $ */ +/* $OpenBSD: pstat.c,v 1.57 2006/03/25 21:11:52 pedro Exp $ */ /* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94"; #else -static char *rcsid = "$OpenBSD: pstat.c,v 1.56 2005/12/28 20:48:18 pedro Exp $"; +static char *rcsid = "$OpenBSD: pstat.c,v 1.57 2006/03/25 21:11:52 pedro Exp $"; #endif #endif /* not lint */ @@ -361,6 +361,12 @@ ufs_print(struct vnode *vp) char *name; mode_t type; + /* Syncer vnodes have no associated inode/dinode. */ + if (VTOI(vp) == NULL) { + printf(" %6c %5c %7c", '-', '-', '-'); + return (0); + } + KGETRET(VTOI(vp), &inode, sizeof(struct inode), "vnode's inode"); KGETRET(inode.i_din1, &di1, sizeof(struct ufs1_dinode), "vnode's dinode"); |