Skip to content
Snippets Groups Projects
Commit db8fb62e authored by rsc's avatar rsc
Browse files

for vs while

parent 236d3369
No related branches found
No related tags found
No related merge requests found
......@@ -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(;;)
;
}
......
......@@ -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;
......
......@@ -20,7 +20,7 @@ main(void)
dup(0);
dup(0);
while(1){
for(;;){
pid = fork();
if(pid < 0){
puts("init: fork failed\n");
......
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment