for vs while

This commit is contained in:
rsc 2006-09-06 18:47:51 +00:00
parent 236d33698b
commit db8fb62e4d
5 changed files with 5 additions and 5 deletions

2
bio.c
View file

@ -39,7 +39,7 @@ getblk(uint dev, uint sector)
acquire(&buf_table_lock);
while(1){
for(;;){
for(b = bufhead.next; b != &bufhead; b = b->next)
if((b->flags & (B_BUSY|B_VALID)) && b->dev == dev && b->sector == sector)
break;

View file

@ -58,7 +58,7 @@ cmain(void)
bad:
outw(0x8A00, 0x8A00);
outw(0x8A00, 0x8E00);
while(1)
for(;;)
;
}

2
fs.c
View file

@ -479,7 +479,7 @@ namei(char *path, int mode, uint *ret_off, char **ret_last, struct inode **ret_i
while(*cp == '/')
cp++;
while(1){
for(;;){
if(*cp == '\0'){
if(mode == NAMEI_LOOKUP)
return dp;

2
init.c
View file

@ -20,7 +20,7 @@ main(void)
dup(0);
dup(0);
while(1){
for(;;){
pid = fork();
if(pid < 0){
puts("init: fork failed\n");

View file

@ -62,7 +62,7 @@ checkstring(uint s)
char c;
int len = 0;
while(1){
for(;;){
if(fetchbyte(curproc[cpu()], s, &c) < 0)
return -1;
if(c == '\0')