Run clang-format after removing ssnprintf
[collectd.git] / src / tcpconns.c
index 732e447..9fdd16e 100644 (file)
@@ -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
 
 /* #endif HAVE_SYSCTLBYNAME */
 
 #elif HAVE_KVM_GETFILES
-#include <sys/types.h>
 #include <sys/sysctl.h>
+#include <sys/types.h>
 #define _KERNEL /* for DTYPE_SOCKET */
 #include <sys/file.h>
 #undef _KERNEL
 #include <net/route.h>
 #include <netdb.h>
 #include <netinet/in.h>
-#include <netinet/ip.h>
 #include <netinet/in_pcb.h>
 #include <netinet/in_systm.h>
+#include <netinet/ip.h>
 #include <netinet/ip_var.h>
 #include <netinet/tcp.h>
 #include <netinet/tcp_timer.h>
@@ -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;