]> granicus.if.org Git - pwauth/commitdiff
Rearranged ifdefs so that undefining SLEEP_LOCK completely disables the
authorjan@unixpapa.com <jan@unixpapa.com@c81c378c-2084-11de-9b1d-7d4d678aad79>
Thu, 11 Jun 2009 13:46:04 +0000 (13:46 +0000)
committerjan@unixpapa.com <jan@unixpapa.com@c81c378c-2084-11de-9b1d-7d4d678aad79>
Thu, 11 Jun 2009 13:46:04 +0000 (13:46 +0000)
sleep on failure behavior.

pwauth/CHANGES
pwauth/snooze.c

index 98cec9de0504bab5c89400d009957d632c0f8589..2c5287dd27ef971aa41b92d1a9a4877192e0ca77 100644 (file)
@@ -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
index fd424f5c2fe7843c093b2d2767c21b551cf18d57..4257abda8c242c36c00326461bc89513e7ea1e21 100644 (file)
  * =======================================================================
  */
 
+
 #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
 
 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