X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Ftcpconns.c;h=9fdd16e9c1b30b7d336c18e0b3620c8a587340e4;hp=732e4479c4af31d44de1e09b590db7b5a0960d10;hb=e746ad785774de37a30302fef65f1c4aaf8698ab;hpb=f81a5a84d3d5fc941b624c28b1ab70971cc23ac9 diff --git a/src/tcpconns.c b/src/tcpconns.c index 732e4479..9fdd16e9 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -70,7 +70,8 @@ #undef HAVE_SYSCTLBYNAME /* force HAVE_LIBKVM_NLIST path */ #endif -#if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_KVM_GETFILES && !HAVE_LIBKVM_NLIST && !KERNEL_AIX +#if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_KVM_GETFILES && \ + !HAVE_LIBKVM_NLIST && !KERNEL_AIX #error "No applicable input method." #endif @@ -110,8 +111,8 @@ /* #endif HAVE_SYSCTLBYNAME */ #elif HAVE_KVM_GETFILES -#include #include +#include #define _KERNEL /* for DTYPE_SOCKET */ #include #undef _KERNEL @@ -127,9 +128,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -293,7 +294,7 @@ static void conn_submit_port_entry(port_entry_t *pe) { if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING)) || (pe->flags & PORT_COLLECT_LOCAL)) { snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), - "%" PRIu16 "-local", pe->port); + "%" PRIu16 "-local", pe->port); for (int i = 1; i <= TCP_STATE_MAX; i++) { vl.values[0].gauge = pe->count_local[i]; @@ -306,7 +307,7 @@ static void conn_submit_port_entry(port_entry_t *pe) { if (pe->flags & PORT_COLLECT_REMOTE) { snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), - "%" PRIu16 "-remote", pe->port); + "%" PRIu16 "-remote", pe->port); for (int i = 1; i <= TCP_STATE_MAX; i++) { vl.values[0].gauge = pe->count_remote[i]; @@ -830,8 +831,7 @@ static int conn_read(void) { conn_reset_port_entry(); - kf = kvm_getfiles(kvmd, KERN_FILE_BYFILE, DTYPE_SOCKET, - sizeof(*kf), &fcnt); + kf = kvm_getfiles(kvmd, KERN_FILE_BYFILE, DTYPE_SOCKET, sizeof(*kf), &fcnt); if (kf == NULL) { ERROR("tcpconns plugin: kvm_getfiles failed."); return -1;