X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_daemon.c;h=c438028134ed5c27b2f89edf8853c529d1c1ad89;hb=a60dc4778c6bd3c7d11f1a58fed2392dfc717a87;hp=f1221e3e3cb347ba8155b59840c37e127a2880dd;hpb=5fe8a76ab35012a0a5e1bd8cc5ff4a6f059f37f5;p=rrdtool.git diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index f1221e3..c438028 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -1479,12 +1479,11 @@ static void *connection_thread_main (void *args) /* {{{ */ status = handle_request (fd, buffer, /*buffer_size=*/ status); if (status != 0) - { - close (fd); break; - } } + close(fd); + self = pthread_self (); /* Remove this thread from the connection threads list */ pthread_mutex_lock (&connection_threads_lock); @@ -1748,8 +1747,12 @@ static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */ pollfds[i].revents = 0; } - status = poll (pollfds, pollfds_num, /* timeout = */ -1); - if (status < 1) + status = poll (pollfds, pollfds_num, /* timeout = */ 1000); + if (status == 0) + { + continue; /* timeout */ + } + else if (status < 0) { status = errno; if (status != EINTR)