Date: Mon, 30 Aug 2010 23:19:21 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212037 - head/sbin/hastd Message-ID: <201008302319.o7UNJLAN011149@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Mon Aug 30 23:19:21 2010 New Revision: 212037 URL: http://svn.freebsd.org/changeset/base/212037 Log: We only want to know if descriptors are ready for reading. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Aug 30 23:16:45 2010 (r212036) +++ head/sbin/hastd/hastd.c Mon Aug 30 23:19:21 2010 (r212037) @@ -624,7 +624,7 @@ close: static void main_loop(void) { - fd_set rfds, wfds; + fd_set rfds; int cfd, lfd, maxfd, ret; struct timeval timeout; @@ -654,11 +654,8 @@ main_loop(void) FD_ZERO(&rfds); FD_SET(cfd, &rfds); FD_SET(lfd, &rfds); - FD_ZERO(&wfds); - FD_SET(cfd, &wfds); - FD_SET(lfd, &wfds); - ret = select(maxfd + 1, &rfds, &wfds, NULL, &timeout); + ret = select(maxfd + 1, &rfds, NULL, NULL, &timeout); if (ret == 0) hook_check(false); else if (ret == -1) { @@ -668,9 +665,9 @@ main_loop(void) pjdlog_exit(EX_OSERR, "select() failed"); } - if (FD_ISSET(cfd, &rfds) || FD_ISSET(cfd, &wfds)) + if (FD_ISSET(cfd, &rfds)) control_handle(cfg); - if (FD_ISSET(lfd, &rfds) || FD_ISSET(lfd, &wfds)) + if (FD_ISSET(lfd, &rfds)) listen_accept(); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008302319.o7UNJLAN011149>