From: octo Date: Sat, 15 Apr 2006 10:04:50 +0000 (+0000) Subject: The defines in the `disk' plugin have been brought to the `state of the art'.. ;) X-Git-Tag: liboping-0.1.0~81 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0f1d31a790c13bc4d80d65e7273b3814c6f18363;p=collectd.git The defines in the `disk' plugin have been brought to the `state of the art'.. ;) --- diff --git a/src/disk.c b/src/disk.c index ded20806..1b8f2f3d 100644 --- a/src/disk.c +++ b/src/disk.c @@ -26,7 +26,7 @@ #define MODULE_NAME "disk" -#if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) +#if KERNEL_LINUX || HAVE_LIBKSTAT # define DISK_HAVE_READ 1 #else # define DISK_HAVE_READ 0 @@ -60,7 +60,7 @@ static char *part_ds_def[] = }; static int part_ds_num = 4; -#ifdef KERNEL_LINUX +#if KERNEL_LINUX typedef struct diskstats { char *name; @@ -78,9 +78,9 @@ typedef struct diskstats } diskstats_t; static diskstats_t *disklist; -/* #endif defined(KERNEL_LINUX) */ +/* #endif KERNEL_LINUX */ -#elif defined(HAVE_LIBKSTAT) +#elif HAVE_LIBKSTAT #define MAX_NUMDISK 256 extern kstat_ctl_t *kc; static kstat_t *ksp[MAX_NUMDISK]; @@ -89,7 +89,11 @@ static int numdisk = 0; static void disk_init (void) { -#ifdef HAVE_LIBKSTAT +#if KERNEL_LINUX + /* No init needed */ +/* #endif KERNEL_LINUX */ + +#elif HAVE_LIBKSTAT kstat_t *ksp_chain; numdisk = 0; @@ -108,7 +112,7 @@ static void disk_init (void) continue; ksp[numdisk++] = ksp_chain; } -#endif +#endif /* HAVE_LIBKSTAT */ return; } @@ -185,7 +189,7 @@ static void partition_submit (char *part_name, static void disk_read (void) { -#ifdef KERNEL_LINUX +#if KERNEL_LINUX FILE *fh; char buffer[1024]; char disk_name[128]; @@ -321,7 +325,7 @@ static void disk_read (void) fclose (fh); /* #endif defined(KERNEL_LINUX) */ -#elif defined(HAVE_LIBKSTAT) +#elif HAVE_LIBKSTAT static kstat_io_t kio; int i;