diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-02 04:07:14 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-02 04:07:14 +0100 |
commit | 940c7206c2a4acb386ab47199a6c313c04387f3b (patch) | |
tree | 9fb4aee464611ffd2cc6edbdf862149037e35f60 | |
parent | 708dd4c98662670f3104b71c2fc5eef82bb726a8 (diff) | |
download | busybox-w32-940c7206c2a4acb386ab47199a6c313c04387f3b.tar.gz busybox-w32-940c7206c2a4acb386ab47199a6c313c04387f3b.tar.bz2 busybox-w32-940c7206c2a4acb386ab47199a6c313c04387f3b.zip |
convert "do {...} while (1);" -> "while (1) {...}"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/split.c | 4 | ||||
-rw-r--r-- | loginutils/vlock.c | 9 | ||||
-rw-r--r-- | networking/route.c | 4 | ||||
-rw-r--r-- | shell/ash.c | 16 |
4 files changed, 17 insertions, 16 deletions
diff --git a/coreutils/split.c b/coreutils/split.c index db5a1727a..79316ed74 100644 --- a/coreutils/split.c +++ b/coreutils/split.c | |||
@@ -32,7 +32,7 @@ static char *next_file(char *old, unsigned suffix_len) | |||
32 | unsigned i = 1; | 32 | unsigned i = 1; |
33 | char *curr; | 33 | char *curr; |
34 | 34 | ||
35 | do { | 35 | while (1) { |
36 | curr = old + end - i; | 36 | curr = old + end - i; |
37 | if (*curr < 'z') { | 37 | if (*curr < 'z') { |
38 | *curr += 1; | 38 | *curr += 1; |
@@ -43,7 +43,7 @@ static char *next_file(char *old, unsigned suffix_len) | |||
43 | return NULL; | 43 | return NULL; |
44 | } | 44 | } |
45 | *curr = 'a'; | 45 | *curr = 'a'; |
46 | } while (1); | 46 | } |
47 | 47 | ||
48 | return old; | 48 | return old; |
49 | } | 49 | } |
diff --git a/loginutils/vlock.c b/loginutils/vlock.c index 216b317f1..0d0f3bca2 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c | |||
@@ -93,16 +93,17 @@ int vlock_main(int argc UNUSED_PARAM, char **argv) | |||
93 | term.c_lflag &= ~(ECHO | ECHOCTL); | 93 | term.c_lflag &= ~(ECHO | ECHOCTL); |
94 | tcsetattr_stdin_TCSANOW(&term); | 94 | tcsetattr_stdin_TCSANOW(&term); |
95 | 95 | ||
96 | do { | 96 | while (1) { |
97 | printf("Virtual console%s locked by %s.\n", | 97 | printf("Virtual console%s locked by %s.\n", |
98 | option_mask32 /*o_lock_all*/ ? "s" : "", | 98 | /* "s" if -a, else "": */ "s" + !option_mask32, |
99 | pw->pw_name); | 99 | pw->pw_name |
100 | ); | ||
100 | if (correct_password(pw)) { | 101 | if (correct_password(pw)) { |
101 | break; | 102 | break; |
102 | } | 103 | } |
103 | bb_do_delay(FAIL_DELAY); | 104 | bb_do_delay(FAIL_DELAY); |
104 | puts("Password incorrect"); | 105 | puts("Password incorrect"); |
105 | } while (1); | 106 | } |
106 | 107 | ||
107 | #ifdef __linux__ | 108 | #ifdef __linux__ |
108 | ioctl(STDIN_FILENO, VT_SETMODE, &ovtm); | 109 | ioctl(STDIN_FILENO, VT_SETMODE, &ovtm); |
diff --git a/networking/route.c b/networking/route.c index ac4fbb472..98a03ded7 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -605,7 +605,7 @@ static void INET6_displayroutes(void) | |||
605 | set_flags(flags, (iflags & IPV6_MASK)); | 605 | set_flags(flags, (iflags & IPV6_MASK)); |
606 | 606 | ||
607 | r = 0; | 607 | r = 0; |
608 | do { | 608 | while (1) { |
609 | inet_pton(AF_INET6, addr6x + r, | 609 | inet_pton(AF_INET6, addr6x + r, |
610 | (struct sockaddr *) &snaddr6.sin6_addr); | 610 | (struct sockaddr *) &snaddr6.sin6_addr); |
611 | snaddr6.sin6_family = AF_INET6; | 611 | snaddr6.sin6_family = AF_INET6; |
@@ -624,7 +624,7 @@ static void INET6_displayroutes(void) | |||
624 | free(naddr6); | 624 | free(naddr6); |
625 | break; | 625 | break; |
626 | } | 626 | } |
627 | } while (1); | 627 | } |
628 | } | 628 | } |
629 | fclose(fp); | 629 | fclose(fp); |
630 | } | 630 | } |
diff --git a/shell/ash.c b/shell/ash.c index 98d2c7c29..c3c953656 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3539,12 +3539,12 @@ set_curjob(struct job *jp, unsigned mode) | |||
3539 | 3539 | ||
3540 | /* first remove from list */ | 3540 | /* first remove from list */ |
3541 | jpp = curp = &curjob; | 3541 | jpp = curp = &curjob; |
3542 | do { | 3542 | while (1) { |
3543 | jp1 = *jpp; | 3543 | jp1 = *jpp; |
3544 | if (jp1 == jp) | 3544 | if (jp1 == jp) |
3545 | break; | 3545 | break; |
3546 | jpp = &jp1->prev_job; | 3546 | jpp = &jp1->prev_job; |
3547 | } while (1); | 3547 | } |
3548 | *jpp = jp1->prev_job; | 3548 | *jpp = jp1->prev_job; |
3549 | 3549 | ||
3550 | /* Then re-insert in correct position */ | 3550 | /* Then re-insert in correct position */ |
@@ -3560,14 +3560,14 @@ set_curjob(struct job *jp, unsigned mode) | |||
3560 | case CUR_RUNNING: | 3560 | case CUR_RUNNING: |
3561 | /* newly created job or backgrounded job, | 3561 | /* newly created job or backgrounded job, |
3562 | put after all stopped jobs. */ | 3562 | put after all stopped jobs. */ |
3563 | do { | 3563 | while (1) { |
3564 | jp1 = *jpp; | 3564 | jp1 = *jpp; |
3565 | #if JOBS | 3565 | #if JOBS |
3566 | if (!jp1 || jp1->state != JOBSTOPPED) | 3566 | if (!jp1 || jp1->state != JOBSTOPPED) |
3567 | #endif | 3567 | #endif |
3568 | break; | 3568 | break; |
3569 | jpp = &jp1->prev_job; | 3569 | jpp = &jp1->prev_job; |
3570 | } while (1); | 3570 | } |
3571 | /* FALLTHROUGH */ | 3571 | /* FALLTHROUGH */ |
3572 | #if JOBS | 3572 | #if JOBS |
3573 | case CUR_STOPPED: | 3573 | case CUR_STOPPED: |
@@ -3740,7 +3740,7 @@ setjobctl(int on) | |||
3740 | goto out; | 3740 | goto out; |
3741 | /* fd is a tty at this point */ | 3741 | /* fd is a tty at this point */ |
3742 | close_on_exec_on(fd); | 3742 | close_on_exec_on(fd); |
3743 | do { /* while we are in the background */ | 3743 | while (1) { /* while we are in the background */ |
3744 | pgrp = tcgetpgrp(fd); | 3744 | pgrp = tcgetpgrp(fd); |
3745 | if (pgrp < 0) { | 3745 | if (pgrp < 0) { |
3746 | out: | 3746 | out: |
@@ -3751,7 +3751,7 @@ setjobctl(int on) | |||
3751 | if (pgrp == getpgrp()) | 3751 | if (pgrp == getpgrp()) |
3752 | break; | 3752 | break; |
3753 | killpg(0, SIGTTIN); | 3753 | killpg(0, SIGTTIN); |
3754 | } while (1); | 3754 | } |
3755 | initialpgrp = pgrp; | 3755 | initialpgrp = pgrp; |
3756 | 3756 | ||
3757 | setsignal(SIGTSTP); | 3757 | setsignal(SIGTSTP); |
@@ -5970,7 +5970,7 @@ expari(int quotes) | |||
5970 | p = expdest - 1; | 5970 | p = expdest - 1; |
5971 | *p = '\0'; | 5971 | *p = '\0'; |
5972 | p--; | 5972 | p--; |
5973 | do { | 5973 | while (1) { |
5974 | int esc; | 5974 | int esc; |
5975 | 5975 | ||
5976 | while ((unsigned char)*p != CTLARI) { | 5976 | while ((unsigned char)*p != CTLARI) { |
@@ -5988,7 +5988,7 @@ expari(int quotes) | |||
5988 | } | 5988 | } |
5989 | 5989 | ||
5990 | p -= esc + 1; | 5990 | p -= esc + 1; |
5991 | } while (1); | 5991 | } |
5992 | 5992 | ||
5993 | begoff = p - start; | 5993 | begoff = p - start; |
5994 | 5994 | ||