From 88ce2dd1ef322ebab0047fcb6441b0c4b61ab4fb Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Mon, 29 Apr 1996 14:48:47 +0000 Subject: [PATCH] Very minor tweak: In __initdb(), a failure to open the local password database is supposed to result in a warning message being syslog()ed. This warning is only supposed to be generated as long as the 'warned' flag hasn't been yet; once the warning is generated, the flag should be set so that the message is only syslog()ed once. However, while the state of the flag is checked properly, the flag's state is never changed, so you always get multiple warnings instead of just one. Pointed out by: Peter Wemm --- lib/libc/gen/getpwent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 2e2005fa7e6..052d150dc13 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -268,7 +268,7 @@ __initdb() #endif return(1); } - if (!warned) + if (!warned++) syslog(LOG_ERR, "%s: %m", p); return(0); }