Merge branch 'ff/nginx'
[collectd.git] / src / disk.c
index 5739f36..490da07 100644 (file)
 #  define UINT_MAX 4294967295U
 #endif
 
-#if HAVE_IOKIT_IOKITLIB_H || KERNEL_LINUX || HAVE_LIBKSTAT
-# define DISK_HAVE_READ 1
-#else
-# define DISK_HAVE_READ 0
-#endif
-
-#if DISK_HAVE_READ
 #if HAVE_IOKIT_IOKITLIB_H
 static mach_port_t io_master_port = MACH_PORT_NULL;
 /* #endif HAVE_IOKIT_IOKITLIB_H */
@@ -102,7 +95,11 @@ static diskstats_t *disklist;
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMDISK];
 static int numdisk = 0;
-#endif /* HAVE_LIBKSTAT */
+/* #endif HAVE_LIBKSTAT */
+
+#else
+# error "No applicable input method."
+#endif
 
 static int disk_init (void)
 {
@@ -421,13 +418,6 @@ static int disk_read (void)
                minor = atoll (fields[1]);
 
                disk_name = fields[2];
-               { /* Strip slashes from disk_name */
-                       int i;
-                       for (i = 0; disk_name[i] != '\0'; i++)
-                               if (disk_name[i] == '/')
-                                       disk_name[i] = '_';
-               }
-
 
                for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
                        if (strcmp (disk_name, ds->name) == 0)
@@ -646,12 +636,9 @@ static int disk_read (void)
 
        return (0);
 } /* int disk_read */
-#endif /* DISK_HAVE_READ */
 
 void module_register (void)
 {
-#if DISK_HAVE_READ
        plugin_register_init ("disk", disk_init);
        plugin_register_read ("disk", disk_read);
-#endif /* DISK_HAVE_READ */
 } /* void module_register */