projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: use bool instead of _Bool
[collectd.git]
/
src
/
disk.c
diff --git
a/src/disk.c
b/src/disk.c
index
004ce9e
..
317e105
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-82,7
+82,7
@@
static mach_port_t io_master_port = MACH_PORT_NULL;
/* This defaults to false for backwards compatibility. Please fix in the next
* major version. */
static mach_port_t io_master_port = MACH_PORT_NULL;
/* This defaults to false for backwards compatibility. Please fix in the next
* major version. */
-static
_B
ool use_bsd_name = 0;
+static
b
ool use_bsd_name = 0;
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
@@
-106,9
+106,9
@@
typedef struct diskstats {
derive_t avg_read_time;
derive_t avg_write_time;
derive_t avg_read_time;
derive_t avg_write_time;
-
_B
ool has_merged;
-
_B
ool has_in_progress;
-
_B
ool has_io_time;
+
b
ool has_merged;
+
b
ool has_in_progress;
+
b
ool has_io_time;
struct diskstats *next;
} diskstats_t;
struct diskstats *next;
} diskstats_t;
@@
-120,6
+120,9
@@
static struct gmesh geom_tree;
/* #endif KERNEL_FREEBSD */
#elif HAVE_LIBKSTAT
/* #endif KERNEL_FREEBSD */
#elif HAVE_LIBKSTAT
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
#define MAX_NUMDISK 1024
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMDISK];
#define MAX_NUMDISK 1024
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMDISK];
@@
-139,7
+142,7
@@
static int pnumdisk;
#error "No applicable input method."
#endif
#error "No applicable input method."
#endif
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
#include <libudev.h>
static char *conf_udev_name_attr = NULL;
#include <libudev.h>
static char *conf_udev_name_attr = NULL;
@@
-173,7
+176,7
@@
static int disk_config(const char *key, const char *value) {
"on Mach / Mac OS X and will be ignored.");
#endif
} else if (strcasecmp("UdevNameAttr", key) == 0) {
"on Mach / Mac OS X and will be ignored.");
#endif
} else if (strcasecmp("UdevNameAttr", key) == 0) {
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
if (conf_udev_name_attr != NULL) {
free(conf_udev_name_attr);
conf_udev_name_attr = NULL;
if (conf_udev_name_attr != NULL) {
free(conf_udev_name_attr);
conf_udev_name_attr = NULL;
@@
-209,7
+212,7
@@
static int disk_init(void) {
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
/* #endif HAVE_IOKIT_IOKITLIB_H */
#elif KERNEL_LINUX
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
if (conf_udev_name_attr != NULL) {
handle_udev = udev_new();
if (handle_udev == NULL) {
if (conf_udev_name_attr != NULL) {
handle_udev = udev_new();
if (handle_udev == NULL) {
@@
-217,7
+220,7
@@
static int disk_init(void) {
return -1;
}
}
return -1;
}
}
-#endif /* HAVE_UDEV_H */
+#endif /* HAVE_
LIB
UDEV_H */
/* #endif KERNEL_LINUX */
#elif KERNEL_FREEBSD
/* #endif KERNEL_LINUX */
#elif KERNEL_FREEBSD
@@
-260,10
+263,10
@@
static int disk_init(void) {
static int disk_shutdown(void) {
#if KERNEL_LINUX
static int disk_shutdown(void) {
#if KERNEL_LINUX
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
if (handle_udev != NULL)
udev_unref(handle_udev);
if (handle_udev != NULL)
udev_unref(handle_udev);
-#endif /* HAVE_UDEV_H */
+#endif /* HAVE_
LIB
UDEV_H */
#endif /* KERNEL_LINUX */
return 0;
} /* int disk_shutdown */
#endif /* KERNEL_LINUX */
return 0;
} /* int disk_shutdown */
@@
-325,7
+328,7
@@
static counter_t disk_calc_time_incr(counter_t delta_time,
}
#endif
}
#endif
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
/**
* Attempt to provide an rename disk instance from an assigned udev attribute.
*
/**
* Attempt to provide an rename disk instance from an assigned udev attribute.
*
@@
-841,7
+844,7
@@
static int disk_read(void) {
output_name = disk_name;
output_name = disk_name;
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
char *alt_name = NULL;
if (conf_udev_name_attr != NULL) {
alt_name =
char *alt_name = NULL;
if (conf_udev_name_attr != NULL) {
alt_name =
@@
-852,7
+855,7
@@
static int disk_read(void) {
#endif
if (ignorelist_match(ignorelist, output_name) != 0) {
#endif
if (ignorelist_match(ignorelist, output_name) != 0) {
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
/* release udev-based alternate name, if allocated */
sfree(alt_name);
#endif
/* release udev-based alternate name, if allocated */
sfree(alt_name);
#endif
@@
-878,7
+881,7
@@
static int disk_read(void) {
submit_io_time(output_name, io_time, weighted_time);
} /* if (is_disk) */
submit_io_time(output_name, io_time, weighted_time);
} /* if (is_disk) */
-#if HAVE_UDEV_H
+#if HAVE_
LIB
UDEV_H
/* release udev-based alternate name, if allocated */
sfree(alt_name);
#endif
/* release udev-based alternate name, if allocated */
sfree(alt_name);
#endif