[monitoring-plugins] check_disk: Fix pthread start routine type

Holger Weiss git at monitoring-plugins.org
Sun Nov 30 11:40:08 CET 2014


 Module: monitoring-plugins
 Branch: check-disk-thread
 Commit: 933ab1b4e2f8564013ce65bfab65bca7355d8b5b
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Fri Nov 28 23:55:03 2014 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=933ab1b

check_disk: Fix pthread start routine type

The function pointer passed as third argument to pthread_create(3) must
be of type void *(*)(void *).

---

 plugins/check_disk.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index a66aaf0..6dbaab4 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -133,7 +133,7 @@ void print_help (void);
 void print_usage (void);
 double calculate_percent(uintmax_t, uintmax_t);
 void stat_path (struct parameter_list *p);
-void do_stat_path (struct parameter_list *p);
+void *do_stat_path (void *p);
 void get_stats (struct parameter_list *p, struct fs_usage *fsp);
 void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
 
@@ -1005,9 +1005,11 @@ stat_path (struct parameter_list *p)
 #endif
 }
 
-void
-do_stat_path (struct parameter_list *p)
+void *
+do_stat_path (void *in)
 {
+  struct parameter_list *p = in;
+
   /* Stat entry to check that dir exists and is accessible */
   if (verbose >= 3)
     printf("calling stat on %s\n", p->name);
@@ -1017,6 +1019,7 @@ do_stat_path (struct parameter_list *p)
     printf("DISK %s - ", _("CRITICAL"));
     die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno));
   }
+  return NULL;
 }
 
 



More information about the Commits mailing list