From: oetiker Date: Wed, 8 Oct 2008 05:47:39 +0000 (+0000) Subject: fix crash reported by Bernard Li - connection_thread_main: avoid double calls to... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e02f89887a32b90b2da65bcbed63690ef764ee8e;p=rrdtool-all.git fix crash reported by Bernard Li - connection_thread_main: avoid double calls to close_connection -- kevin git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1590 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c index 9c8847dd..36d418b1 100644 --- a/program/src/rrd_daemon.c +++ b/program/src/rrd_daemon.c @@ -1844,23 +1844,18 @@ static void *connection_thread_main (void *args) /* {{{ */ else if (status < 0) /* error */ { status = errno; - if (status == EINTR) - continue; - RRDD_LOG (LOG_ERR, "connection_thread_main: poll(2) failed."); + if (status != EINTR) + RRDD_LOG (LOG_ERR, "connection_thread_main: poll(2) failed."); continue; } if ((pollfd.revents & POLLHUP) != 0) /* normal shutdown */ - { - close_connection(sock); break; - } else if ((pollfd.revents & (POLLIN | POLLPRI)) == 0) { RRDD_LOG (LOG_WARNING, "connection_thread_main: " "poll(2) returned something unexpected: %#04hx", pollfd.revents); - close_connection(sock); break; }