X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=897ebfc5aef8df149a18e131d1b8b0d3b2b1587b;hb=6108316e4008edce45c6d861b49e339c1360181f;hp=d4bf004731abf3142253a9833a742004f48420a0;hpb=5eb1fef6de7e0c8fb99e3d85063d96d7cc785f9b;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index d4bf0047..897ebfc5 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -25,9 +25,9 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_cmd_flush.h" #include "utils_cmd_getval.h" @@ -76,7 +76,7 @@ static pthread_t listen_thread = (pthread_t) 0; */ static int us_open_socket (void) { - struct sockaddr_un sa; + struct sockaddr_un sa = { 0 }; int status; sock_fd = socket (PF_UNIX, SOCK_STREAM, 0); @@ -88,7 +88,6 @@ static int us_open_socket (void) return (-1); } - memset (&sa, '\0', sizeof (sa)); sa.sun_family = AF_UNIX; sstrncpy (sa.sun_path, (sock_file != NULL) ? sock_file : US_DEFAULT_PATH, sizeof (sa.sun_path)); @@ -298,11 +297,11 @@ static void *us_handle_client (void *arg) } else if (strcasecmp (fields[0], "putval") == 0) { - handle_putval (fhout, buffer); + cmd_handle_putval (fhout, buffer); } else if (strcasecmp (fields[0], "listval") == 0) { - handle_listval (fhout, buffer); + cmd_handle_listval (fhout, buffer); } else if (strcasecmp (fields[0], "putnotif") == 0) { @@ -310,7 +309,7 @@ static void *us_handle_client (void *arg) } else if (strcasecmp (fields[0], "flush") == 0) { - handle_flush (fhout, buffer); + cmd_handle_flush (fhout, buffer); } else {