for vs while
This commit is contained in:
parent
236d33698b
commit
db8fb62e4d
2
bio.c
2
bio.c
|
@ -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;
|
||||
|
|
|
@ -58,7 +58,7 @@ cmain(void)
|
|||
bad:
|
||||
outw(0x8A00, 0x8A00);
|
||||
outw(0x8A00, 0x8E00);
|
||||
while(1)
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
|
||||
|
|
2
fs.c
2
fs.c
|
@ -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
2
init.c
|
@ -20,7 +20,7 @@ main(void)
|
|||
dup(0);
|
||||
dup(0);
|
||||
|
||||
while(1){
|
||||
for(;;){
|
||||
pid = fork();
|
||||
if(pid < 0){
|
||||
puts("init: fork failed\n");
|
||||
|
|
Loading…
Reference in a new issue