diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-16 16:14:36 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-16 16:14:36 +0000 |
commit | 3b4821547f38695990aaeea8f8f9b2929535aab1 (patch) | |
tree | cb3a588747979acd44b4a0d62746414dee632122 | |
parent | 0ef29ddfd2071ccfb41db68cc4295fa1b2bec89a (diff) |
At Theo's request only print 'Please wait' if don't get the lock
on the first try.
-rw-r--r-- | usr.bin/chpass/chpass.c | 10 | ||||
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index 5648918cbd6..89b9aa69a9e 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chpass.c,v 1.17 2001/08/15 20:47:53 millert Exp $ */ +/* $OpenBSD: chpass.c,v 1.18 2001/08/16 16:14:35 millert Exp $ */ /* $NetBSD: chpass.c,v 1.8 1996/05/15 21:50:43 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)chpass.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: chpass.c,v 1.17 2001/08/15 20:47:53 millert Exp $"; +static char rcsid[] = "$OpenBSD: chpass.c,v 1.18 2001/08/16 16:14:35 millert Exp $"; #endif #endif /* not lint */ @@ -206,14 +206,16 @@ main(argc, argv) for (;;) { int i, c, d; - (void)fputs("Please wait", stderr); for (i = 0; i < (s ? 64 : 8) && (tfd = pw_lock(0)) == -1; i++) { + if (i == 0) + (void)fputs("Please wait", stderr); (void)signal(SIGINT, kbintr); fputc('.', stderr); usleep(250000); (void)signal(SIGINT, SIG_IGN); } - fputc('\n', stderr); + if (i) + fputc('\n', stderr); if (tfd != -1) break; diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 4e3bc1ae69c..4a688506053 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.16 2001/07/07 00:10:49 millert Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.17 2001/08/16 16:14:35 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static const char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ -static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.16 2001/07/07 00:10:49 millert Exp $"; +static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.17 2001/08/16 16:14:35 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -112,14 +112,16 @@ local_passwd(uname, authenticated) for (;;) { int i, c, d; - (void)fputs("Please wait", stderr); for (i = 0; i < (s ? 64 : 8) && (tfd = pw_lock(0)) == -1; i++) { + if (i == 0) + (void)fputs("Please wait", stderr); (void)signal(SIGINT, kbintr); fputc('.', stderr); usleep(250000); (void)signal(SIGINT, SIG_IGN); } - fputc('\n', stderr); + if (i) + fputc('\n', stderr); if (tfd != -1) break; |