lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit d076cb6279b059a46a34d46a4577f2a9f141035c
parent 66d931479ee07220b42914e7af4ec43ea52fdd75
Author: Duncaen <mail@duncano.de>
Date:   Thu, 15 Jun 2017 21:06:02 +0200

bin/df: skip filesystems without blocks on linux like the cgroup subdirs

Diffstat:
bin/df/df.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/bin/df/df.c b/bin/df/df.c @@ -321,6 +321,11 @@ prtstat(struct statfs *sfsp, int maxwidth, int headerlen, int blocksize) u_int64_t used, inodes; int64_t availblks; +#if __linux__ + if (sfsp->f_blocks == 0) + return; +#endif + (void)printf("%-*.*s", maxwidth, maxwidth, sfsp->f_mntfromname); used = sfsp->f_blocks - sfsp->f_bfree; availblks = sfsp->f_bavail + used; @@ -407,6 +412,10 @@ posixprint(struct statfs *mntbuf, long mntsize, int maxwidth) for (i = 0; i < mntsize; i++) { sfsp = &mntbuf[i]; +#if __linux__ + if (sfsp->f_blocks == 0) + continue; +#endif used = sfsp->f_blocks - sfsp->f_bfree; avail = sfsp->f_bavail + used; if (avail == 0)