Author: pjd
Date: Mon Nov 15 03:07:42 2010
New Revision: 215332
URL: http://svn.freebsd.org/changeset/base/215332

Log:
  Move timeout.tv_sec initialization outside the loop - sigtimedwait(2) won't
  modify it.
  
  Submitted by: Mikolaj Golub <to.my.troc...@gmail.com>
  MFC after:    3 days

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c   Mon Nov 15 03:05:33 2010        (r215331)
+++ head/sbin/hastd/primary.c   Mon Nov 15 03:07:42 2010        (r215332)
@@ -2010,6 +2010,7 @@ guard_thread(void *arg)
        PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0);
        PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0);
 
+       timeout.tv_sec = RETRY_SLEEP;
        timeout.tv_nsec = 0;
        signo = -1;
 
@@ -2035,7 +2036,6 @@ guard_thread(void *arg)
                                guard_one(res, ii);
                        lastcheck = now;
                }
-               timeout.tv_sec = RETRY_SLEEP;
                signo = sigtimedwait(&mask, NULL, &timeout);
        }
        /* NOTREACHED */
_______________________________________________
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