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();
        }
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to