diff options
author | pjd <pjd@FreeBSD.org> | 2010-08-30 23:19:21 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-08-30 23:19:21 +0000 |
commit | 8a7b72b9d3f5a419b8558fe232480453f6c4c070 (patch) | |
tree | 5dc5549b9cb93109c355e1a799d9dfd669285a9f /sbin/hastd | |
parent | 95ca781a2e1c74abfb34c20c7cae2f9a43119ab5 (diff) | |
download | FreeBSD-src-8a7b72b9d3f5a419b8558fe232480453f6c4c070.zip FreeBSD-src-8a7b72b9d3f5a419b8558fe232480453f6c4c070.tar.gz |
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
Diffstat (limited to 'sbin/hastd')
-rw-r--r-- | sbin/hastd/hastd.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c index ad80c8e..ccc25cf 100644 --- a/sbin/hastd/hastd.c +++ b/sbin/hastd/hastd.c @@ -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(); } } |