Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102868950
D34515.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34515.diff
View Options
diff --git a/bin/df/df.1 b/bin/df/df.1
--- a/bin/df/df.1
+++ b/bin/df/df.1
@@ -29,7 +29,7 @@
.\" @(#)df.1 8.3 (Berkeley) 5/8/95
.\" $FreeBSD$
.\"
-.Dd October 5, 2020
+.Dd March 11, 2022
.Dt DF 1
.Os
.Sh NAME
@@ -109,6 +109,9 @@
or
.Fl H
options, the number of inodes is scaled by powers of 1000.
+In case the filesystem has no inodes then
+.Sq -
+is displayed instead of the usage percentage.
.It Fl k
Use 1024 byte (1 Kibibyte) blocks rather than the default.
This overrides the
diff --git a/bin/df/df.c b/bin/df/df.c
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -561,9 +561,12 @@
xo_emit(format, mwp->iused, (intmax_t)used,
mwp->ifree, (intmax_t)sfsp->f_ffree);
}
- xo_emit(" {:inodes-used-percent/%4.0f}{U:%%} ",
- inodes == 0 ? 100.0 :
- (double)used / (double)inodes * 100.0);
+ if (inodes == 0)
+ xo_emit(" {:inodes-used-percent/ -}{U:} ");
+ else {
+ xo_emit(" {:inodes-used-percent/%4.0f}{U:%%} ",
+ (double)used / (double)inodes * 100.0);
+ }
} else
xo_emit(" ");
if (strncmp(sfsp->f_mntfromname, "total", MNAMELEN) != 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 5:30 AM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14711137
Default Alt Text
D34515.diff (1 KB)
Attached To
Mode
D34515: df: do not report a 100% full inode usage on fs without inodes
Attached
Detach File
Event Timeline
Log In to Comment