ソースを参照

check_disk: Fix pthread start routine type

The function pointer passed as third argument to pthread_create(3) must
be of type void *(*)(void *).
Holger Weiss 11 年 前
コミット
bb860dc74c
1 ファイル変更6 行追加3 行削除
  1. 6 3
      plugins/check_disk.c

+ 6 - 3
plugins/check_disk.c

@@ -133,7 +133,7 @@ void print_help (void);
 void print_usage (void);
 void print_usage (void);
 double calculate_percent(uintmax_t, uintmax_t);
 double calculate_percent(uintmax_t, uintmax_t);
 void stat_path (struct parameter_list *p);
 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_stats (struct parameter_list *p, struct fs_usage *fsp);
 void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
 void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
 
 
@@ -1027,9 +1027,11 @@ stat_path (struct parameter_list *p)
 #endif
 #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 */
   /* Stat entry to check that dir exists and is accessible */
   if (verbose >= 3)
   if (verbose >= 3)
     printf("calling stat on %s\n", p->name);
     printf("calling stat on %s\n", p->name);
@@ -1039,6 +1041,7 @@ do_stat_path (struct parameter_list *p)
     printf("DISK %s - ", _("CRITICAL"));
     printf("DISK %s - ", _("CRITICAL"));
     die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno));
     die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno));
   }
   }
+  return NULL;
 }
 }