summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenys Vlasenko2011-03-02 04:07:14 +0100
committerDenys Vlasenko2011-03-02 04:07:14 +0100
commit940c7206c2a4acb386ab47199a6c313c04387f3b (patch)
tree9fb4aee464611ffd2cc6edbdf862149037e35f60 /loginutils
parent708dd4c98662670f3104b71c2fc5eef82bb726a8 (diff)
downloadbusybox-940c7206c2a4acb386ab47199a6c313c04387f3b.zip
busybox-940c7206c2a4acb386ab47199a6c313c04387f3b.tar.gz
convert "do {...} while (1);" -> "while (1) {...}"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/vlock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index 216b317..0d0f3bc 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -93,16 +93,17 @@ int vlock_main(int argc UNUSED_PARAM, char **argv)
term.c_lflag &= ~(ECHO | ECHOCTL);
tcsetattr_stdin_TCSANOW(&term);
- do {
+ while (1) {
printf("Virtual console%s locked by %s.\n",
- option_mask32 /*o_lock_all*/ ? "s" : "",
- pw->pw_name);
+ /* "s" if -a, else "": */ "s" + !option_mask32,
+ pw->pw_name
+ );
if (correct_password(pw)) {
break;
}
bb_do_delay(FAIL_DELAY);
puts("Password incorrect");
- } while (1);
+ }
#ifdef __linux__
ioctl(STDIN_FILENO, VT_SETMODE, &ovtm);