Skip to content
Permalink
Browse files

multiload: ignore priviledged mount points

  • Loading branch information...
lanoxx authored and raveit65 committed May 26, 2018
1 parent 151311f commit 3b5b33a095f1064970cf33dd6530fd0721fb4982
Showing with 9 additions and 0 deletions.
  1. +9 −0 multiload/linux-proc.c
@@ -1,6 +1,7 @@
/* From wmload.c, v0.9.2, licensed under the GPL. */
#include <config.h>
#include <sys/types.h>
#include <sys/statvfs.h>
#include <math.h>
#include <fcntl.h>
#include <unistd.h>
@@ -119,13 +120,21 @@ GetDiskLoad (int Maximum, int data [3], LoadGraph *g)

for (i = 0; i < mountlist.number; i++)
{
struct statvfs statresult;
glibtop_fsusage fsusage;

if (strcmp(mountentries[i].type, "smbfs") == 0
|| strcmp(mountentries[i].type, "nfs") == 0
|| strcmp(mountentries[i].type, "cifs") == 0)
continue;

if (statvfs (mountentries[i].mountdir, &statresult) < 0)
{
g_debug ("Failed to get statistics for mount entry: %s. Reason: %s. Skipping entry.",
mountentries[i].mountdir, strerror(errno));
continue;
}

glibtop_get_fsusage(&fsusage, mountentries[i].mountdir);
read += fsusage.read; write += fsusage.write;
}

0 comments on commit 3b5b33a

Please sign in to comment.
You can’t perform that action at this time.