From: jan@unixpapa.com Date: Thu, 11 Jun 2009 13:46:04 +0000 (+0000) Subject: Rearranged ifdefs so that undefining SLEEP_LOCK completely disables the X-Git-Tag: pwauth-2.3.10~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7d7bc6c9362e11e9a58fd7d4009906c4e4d641f;p=pwauth Rearranged ifdefs so that undefining SLEEP_LOCK completely disables the sleep on failure behavior. --- diff --git a/pwauth/CHANGES b/pwauth/CHANGES index 98cec9d..2c5287d 100644 --- a/pwauth/CHANGES +++ b/pwauth/CHANGES @@ -2,6 +2,8 @@ Pwauth Change Log ================= VERSION 2.3.9 - + - Rearranged ifdef's so that undefining SLEEP_LOCK actually completely + disables the sleep-on-failure behavior. - Minor documentation fixes VERSION 2.3.8 - Apr 3, 2009 diff --git a/pwauth/snooze.c b/pwauth/snooze.c index fd424f5..4257abd 100644 --- a/pwauth/snooze.c +++ b/pwauth/snooze.c @@ -31,8 +31,11 @@ * ======================================================================= */ + #include "pwauth.h" +#ifdef SLEEP_LOCK + /* SNOOZE - Do a serialized sleep of the given number of seconds. This means, * wait till no other pwauth processes are in their sleeps, and then sleep * for the number of seconds given. Note that a snooze(0) may lead to some @@ -41,21 +44,17 @@ snooze(int seconds) { -#ifdef SLEEP_LOCK int slfd; -#endif /* Lock the sleep-lock file to serialize our sleeps */ -#ifdef SLEEP_LOCK if ((slfd= open(SLEEP_LOCK,O_CREAT|O_RDONLY,0644)) >= 0) flock(slfd,LOCK_EX); -#endif sleep(seconds); /* Release sleep-lock file */ -#ifdef SLEEP_LOCK /*flock(slfd,LOCK_UN);*/ close(slfd); -#endif } + +#endif