summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat/pstat.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-10-07 02:30:02 +0000
committerderaadt <deraadt@openbsd.org>2008-10-07 02:30:02 +0000
commit0c75dadaea7b05059dd3fc6564b88bf47745bd63 (patch)
treeef85723cc772e08d3333324a4b35807f5df93d2e /usr.sbin/pstat/pstat.c
parentDo not display file offsets and a few other pieces of information, except (diff)
downloadwireguard-openbsd-0c75dadaea7b05059dd3fc6564b88bf47745bd63.tar.xz
wireguard-openbsd-0c75dadaea7b05059dd3fc6564b88bf47745bd63.zip
pstat can hide information too; also based on PR 5113
Diffstat (limited to 'usr.sbin/pstat/pstat.c')
-rw-r--r--usr.sbin/pstat/pstat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index 004edf2e277..24029b1568c 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pstat.c,v 1.74 2008/09/01 08:50:07 sobrado Exp $ */
+/* $OpenBSD: pstat.c,v 1.75 2008/10/07 02:30:02 deraadt 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.74 2008/09/01 08:50:07 sobrado Exp $";
+static char *rcsid = "$OpenBSD: pstat.c,v 1.75 2008/10/07 02:30:02 deraadt Exp $";
#endif
#endif /* not lint */
@@ -1058,7 +1058,9 @@ filemode(void)
(void)printf(" %3ld", fp.f_msgcount);
(void)printf(" %0*lx", 2 * (int)sizeof(long), (long)fp.f_data);
- if (fp.f_offset < 0)
+ if (fp.f_offset == (off_t)-1)
+ (void)printf(" *\n");
+ else if (fp.f_offset < 0)
(void)printf(" %llx\n", (long long)fp.f_offset);
else
(void)printf(" %lld\n", (long long)fp.f_offset);