summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/freebsd/fsusage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/freebsd/fsusage.c b/sysdeps/freebsd/fsusage.c
index 88b9b391..b6f87a0c 100644
--- a/sysdeps/freebsd/fsusage.c
+++ b/sysdeps/freebsd/fsusage.c
@@ -132,7 +132,9 @@ _glibtop_get_fsusage_read_write (glibtop *server, glibtop_fsusage *buf, const ch
buf->read = sfs.f_syncreads + sfs.f_asyncreads;
buf->write = sfs.f_syncwrites + sfs.f_asyncwrites;
#endif
- buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
+ if (buf->read || buf->write) {
+ buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
+ }
}
void