X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=3dac88a49b437ec8105c170faf1366c65178f605;hb=bc5877df666a8befe63ae4f56fcad849d9c5427a;hp=d80091b1bd18bfffd290ae4c7a54b6086131605f;hpb=1862f170da675eb9bbf53193b93e3e9cbcb97540;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index d80091b1..3dac88a4 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -382,8 +382,15 @@ static int us_config (const char *key, const char *val) static int us_init (void) { + static int have_init = 0; + int status; + /* Initialize only once. */ + if (have_init != 0) + return (0); + have_init = 1; + loop = 1; status = pthread_create (&listen_thread, NULL, us_server_thread, NULL);