X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=1faeff9c5cd00fc9ed10bb1afdbd0719587e0329;hb=141816828389e3ad98f66db29b4a702479dcb05d;hp=1840e34c45a157825fd8a9b8052a1b56500480ca;hpb=b81104a423234c04f0eb4ace0ec5e93a363c917a;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index 1840e34c..1faeff9c 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -36,9 +37,6 @@ #include "utils_cmd_putval.h" #include "utils_cmd_putnotif.h" -/* Folks without pthread will need to disable this plugin. */ -#include - #include #include @@ -79,7 +77,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); @@ -91,7 +89,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));