From: Edgar Fuß Date: Fri, 15 Nov 2019 18:11:42 +0000 (+0100) Subject: Address some clang-format issues X-Git-Tag: collectd-5.11.0~44^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb97bf10a6fd104a1266ea62115c41f8de49d6a9;p=thirdparty%2Fcollectd.git Address some clang-format issues Remove some white space, re-order #include's. clang-format would also like to re-format some code I didn't modify (changing indentation of /* #endif ... */ comments and normalize the line wrapping on two disk_submit() calls into a form I find harder to understand. --- diff --git a/src/disk.c b/src/disk.c index d26e8c0a6..ff4bab705 100644 --- a/src/disk.c +++ b/src/disk.c @@ -137,8 +137,8 @@ static int pnumdisk; #elif HAVE_SYSCTL && KERNEL_NETBSD -#include #include +#include static struct io_sysctl *drives = NULL; static size_t ndrive = 0; @@ -273,18 +273,18 @@ static int disk_init(void) { mib[1] = HW_IOSTATS; mib[2] = sizeof(struct io_sysctl); if (sysctl(mib, 3, NULL, &size, NULL, 0) == -1) { - ERROR ("disk plugin: sysctl for ndrives failed"); + ERROR("disk plugin: sysctl for ndrives failed"); return -1; } ndrive = size / sizeof(struct io_sysctl); - if (size == 0 ) { - ERROR ("disk plugin: no drives found"); + if (size == 0) { + ERROR("disk plugin: no drives found"); return -1; } drives = (struct io_sysctl *)malloc(size); if (drives == NULL) { - ERROR ("disk plugin: memory allocation failure"); + ERROR("disk plugin: memory allocation failure"); return -1; } #endif /* HAVE_SYSCTL && KERNEL_NETBSD */ @@ -1069,20 +1069,20 @@ static int disk_read(void) { mib[1] = HW_IOSTATS; mib[2] = sizeof(struct io_sysctl); if (sysctl(mib, 3, NULL, &size, NULL, 0) == -1) { - ERROR ("disk plugin: sysctl for ndrives failed"); + ERROR("disk plugin: sysctl for ndrives failed"); return -1; } nndrive = size / sizeof(struct io_sysctl); - if (size == 0 ) { - ERROR ("disk plugin: no drives found"); + if (size == 0) { + ERROR("disk plugin: no drives found"); return -1; } /* number of drives changed, reallocate buffer */ if (nndrive != ndrive) { drives = (struct io_sysctl *)realloc(drives, size); if (drives == NULL) { - ERROR ("disk plugin: memory allocation failure"); + ERROR("disk plugin: memory allocation failure"); return -1; } ndrive = nndrive; @@ -1093,7 +1093,7 @@ static int disk_read(void) { mib[1] = HW_IOSTATS; mib[2] = sizeof(struct io_sysctl); if (sysctl(mib, 3, drives, &size, NULL, 0) == -1) { - ERROR ("disk plugin: sysctl for drive stats failed"); + ERROR("disk plugin: sysctl for drive stats failed"); return -1; }