summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-30 23:19:21 +0000
committerpjd <pjd@FreeBSD.org>2010-08-30 23:19:21 +0000
commit8a7b72b9d3f5a419b8558fe232480453f6c4c070 (patch)
tree5dc5549b9cb93109c355e1a799d9dfd669285a9f /sbin
parent95ca781a2e1c74abfb34c20c7cae2f9a43119ab5 (diff)
downloadFreeBSD-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')
-rw-r--r--sbin/hastd/hastd.c11
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();
}
}
OpenPOWER on IntegriCloud