X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Funixsock.c;h=5454fd8c273eb948b9d119e4d4dab73414c0636f;hb=610204218564e01513607a0f077c33145f2b41f7;hp=1840e34c45a157825fd8a9b8052a1b56500480ca;hpb=441e067a2d5a294517bd87ca45c87fd67377d2cf;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index 1840e34c..5454fd8c 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -36,9 +36,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 +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); @@ -91,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));