summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-10-02 23:16:09 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-10-02 23:16:09 +0000
commit0363a9535ff2e07684153ea8eb8cc15e2052c2d6 (patch)
tree015a60333caffcad0edc55e51c6a8150945faec9 /usr.bin
parent9a98e2536a0fcdd401f7cfac287bd6269a19e4ef (diff)
Indicate with an asterisk when a file has been unlinked.
from Sebastien Marie
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fstat/fstat.17
-rw-r--r--usr.bin/fstat/fstat.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/fstat/fstat.1 b/usr.bin/fstat/fstat.1
index 1ab5782c395..a3de615742c 100644
--- a/usr.bin/fstat/fstat.1
+++ b/usr.bin/fstat/fstat.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fstat.1,v 1.52 2016/04/25 19:18:41 tedu Exp $
+.\" $OpenBSD: fstat.1,v 1.53 2016/10/02 23:16:08 guenther Exp $
.\"
.\" Copyright (c) 1987, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)fstat.1 8.3 (Berkeley) 2/25/94
.\"
-.Dd $Mdocdate: April 25 2016 $
+.Dd $Mdocdate: October 2 2016 $
.Dt FSTAT 1
.Os
.Sh NAME
@@ -146,6 +146,9 @@ flag is specified, this header is present and is the
major/minor number of the device that this file resides in.
.It Li INUM
The inode number of the file.
+It will be followed by an asterisk
+.Pq Ql *
+if the inode is unlinked from disk.
.It Li MODE
The mode of the file.
If the
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 1699daf934a..5656574cda0 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.88 2016/05/04 19:48:08 jca Exp $ */
+/* $OpenBSD: fstat.c,v 1.89 2016/10/02 23:16:08 guenther Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -441,7 +441,9 @@ vtrans(struct kinfo_file *kf)
(void)snprintf(mode, sizeof(mode), "%o", kf->va_mode);
else
strmode(kf->va_mode, mode);
- printf(" %8llu %11s", kf->va_fileid, mode);
+ printf(" %8llu%s %11s", kf->va_fileid,
+ kf->va_nlink == 0 ? "*" : " ",
+ mode);
rw[0] = '\0';
if (kf->f_flag & FREAD)
strlcat(rw, "r", sizeof rw);