aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-01-15 11:34:15 +0000
committerGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-01-15 11:34:15 +0000
commitb7676a7e6df517827f48c2f105261d5676b5e694 (patch)
tree74d9c79187df934319b8dfb9b0b8f6fb64a70519 /plugins/check_disk.c
parent546410a5f94cd796ff6b7ba531dca8f0d1971471 (diff)
downloadmonitoring-plugins-b7676a7e6df517827f48c2f105261d5676b5e694.tar.gz
Fix check_disk disk usage calculation when using --group=NAME (related to bug #1348746)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1907 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index b8bbdbda..5ef957de 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -265,7 +265,8 @@ main (int argc, char **argv)
(fsp.fsu_blocks + tmpfsp.fsu_blocks); /* Size of a block. */
fsp.fsu_blocks += tmpfsp.fsu_blocks; /* Total blocks. */
fsp.fsu_bfree += tmpfsp.fsu_bfree; /* Free blocks available to superuser. */
- fsp.fsu_bavail += tmpfsp.fsu_bavail; /* Free blocks available to non-superuser. */
+ /* Gnulib workaround - see comment about it a few lines below */
+ fsp.fsu_bavail += (tmpfsp.fsu_bavail > tmpfsp.fsu_bfree ? 0 : tmpfsp.fsu_bavail); /* Free blocks available to non-superuser. */
fsp.fsu_files += tmpfsp.fsu_files; /* Total file nodes. */
fsp.fsu_ffree += tmpfsp.fsu_ffree; /* Free file nodes. */