X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Funixsock.c;h=3dac88a49b437ec8105c170faf1366c65178f605;hb=a019b6c8144745db63c599680bd693ac02f11666;hp=d80091b1bd18bfffd290ae4c7a54b6086131605f;hpb=c60c6dfa5960b23bdc59341ae73e701dd59d4305;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);