Просмотр исходного кода

Merge branch 'georgehansper-master'

madlohe 4 лет назад
Родитель
Сommit
21520b0d52
3 измененных файлов с 7 добавлено и 1 удалено
  1. 1 0
      NEWS
  2. 1 0
      THANKS.in
  3. 5 1
      plugins/check_disk.c

+ 1 - 0
NEWS

@@ -2,6 +2,7 @@ This file documents the major additions and syntax changes between releases.
 
 2.3.4 ????-??-??
 	pst3.c: Fix build issue on Solaris (#537)
+	check_disk: Fix false DISK CRITICAL alerts on btrfs systems (#569) (George Hansper)
 	check_log: Fix error message for systems that don't use bash (#539)
 	check_icmp: Add -f and -F perfdata options (#567)
 	negate: Errors are now printed directly to stderr instead of being redirected to stdout (#571) (Geert Hendrickx)

+ 1 - 0
THANKS.in

@@ -131,6 +131,7 @@ Geert Hendrickx
 Geoff Oakham
 Geoff Oakham
 George Paraskevas
+George Hansper
 Gerd Mueller
 Gerhard Lausser
 Gianluca Varisco

+ 5 - 1
plugins/check_disk.c

@@ -1310,10 +1310,14 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
 
 void
 get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(OpenBSD )
   /* 2007-12-08 - Workaround for Gnulib reporting insanely high available
   * space on BSD (the actual value should be negative but fsp->fsu_bavail
   * is unsigned) */
   p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail;
+#else
+  p->available = fsp->fsu_bavail;
+#endif
   p->available_to_root = fsp->fsu_bfree;
   p->used = fsp->fsu_blocks - fsp->fsu_bfree;
   if (freespace_ignore_reserved) {
@@ -1403,4 +1407,4 @@ human_disk_entry_comparer(const void* _lhs, const void* _rhs) {
     } else {
         return lhs->disk_result < rhs->disk_result ? 1 : -1;
     }
-}
+}