src/rrd_daemon.c: Create listen threads in the detached state.
authorFlorian Forster <octo@leeloo.home.verplant.org>
Thu, 3 Jul 2008 20:49:51 +0000 (22:49 +0200)
committerFlorian Forster <octo@leeloo.home.verplant.org>
Thu, 3 Jul 2008 20:49:51 +0000 (22:49 +0200)
src/rrd_daemon.c

index bc44b81..17dca62 100644 (file)
@@ -1366,6 +1366,7 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
       struct sockaddr_storage client_sa;
       socklen_t client_sa_size;
       pthread_t tid;
+      pthread_attr_t attr;
 
       if (pollfds[i].revents == 0)
         continue;
@@ -1394,7 +1395,10 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
         continue;
       }
 
-      status = pthread_create (&tid, /* attr = */ NULL, connection_thread_main,
+      pthread_attr_init (&attr);
+      pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+      status = pthread_create (&tid, &attr, connection_thread_main,
           /* args = */ (void *) client_sd);
       if (status != 0)
       {