/* #endif defined(VM_SWAPUSAGE) */
#elif HAVE_LIBKVM_GETSWAPINFO
-static kvm_t *kvm_obj = NULL;
+static kvm_t *kvm_obj;
int kvm_pagesize;
/* #endif HAVE_LIBKVM_GETSWAPINFO */
#error "No applicable input method."
#endif /* HAVE_LIBSTATGRAB */
-static bool values_absolute = 1;
+static bool values_absolute = true;
static bool values_percentage;
-static bool report_io = 1;
+static bool report_io = true;
static int swap_config(oconfig_item_t *ci) /* {{{ */
{
sstrncpy(vl.type, "swap", sizeof(vl.type));
if (values_absolute)
- plugin_dispatch_multivalue(&vl, 0, DS_TYPE_GAUGE, "used", used, "free",
+ plugin_dispatch_multivalue(&vl, false, DS_TYPE_GAUGE, "used", used, "free",
free, other_name, other_value, NULL);
if (values_percentage)
- plugin_dispatch_multivalue(&vl, 1, DS_TYPE_GAUGE, "used", used, "free",
+ plugin_dispatch_multivalue(&vl, true, DS_TYPE_GAUGE, "used", used, "free",
free, other_name, other_value, NULL);
} /* }}} void swap_submit_usage */
FILE *fh;
char buffer[1024];
- bool old_kernel = 0;
+ bool old_kernel = false;
uint8_t have_data = 0;
derive_t swap_in = 0;
WARNING("swap: fopen: %s", STRERRNO);
return -1;
} else
- old_kernel = 1;
+ old_kernel = true;
}
while (fgets(buffer, sizeof(buffer), fh) != NULL) {
return -1;
}
- /* If the "separate" option was specified (report_by_device == 1), all
+ /* If the "separate" option was specified (report_by_device == true) all
* values have already been dispatched from within the loop. */
if (!report_by_device)
swap_submit_usage(NULL, total - avail, avail, NULL, NAN);