From ec5f555493c65604767f243d015cee2b856c31b6 Mon Sep 17 00:00:00 2001 From: pjd Date: Mon, 15 Nov 2010 03:07:42 +0000 Subject: [PATCH] Move timeout.tv_sec initialization outside the loop - sigtimedwait(2) won't modify it. Submitted by: Mikolaj Golub MFC after: 3 days --- sbin/hastd/primary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index cfc250867f2..0f9404bbe85 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -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 */ -- 2.45.2