From db8fb62e4d599f4e08a3b6420e42b2445e8d7fe3 Mon Sep 17 00:00:00 2001
From: rsc <rsc>
Date: Wed, 6 Sep 2006 18:47:51 +0000
Subject: [PATCH] for vs while

---
 bio.c      | 2 +-
 bootmain.c | 2 +-
 fs.c       | 2 +-
 init.c     | 2 +-
 syscall.c  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bio.c b/bio.c
index 17965d1..62675bf 100644
--- a/bio.c
+++ b/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;
diff --git a/bootmain.c b/bootmain.c
index 69c5b79..c0c7a24 100644
--- a/bootmain.c
+++ b/bootmain.c
@@ -58,7 +58,7 @@ cmain(void)
 bad:
   outw(0x8A00, 0x8A00);
   outw(0x8A00, 0x8E00);
-  while(1)
+  for(;;)
     ;
 }
 
diff --git a/fs.c b/fs.c
index 91d76cc..e94ae5e 100644
--- a/fs.c
+++ b/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;
diff --git a/init.c b/init.c
index 5f691fc..ff6feaf 100644
--- a/init.c
+++ b/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");
diff --git a/syscall.c b/syscall.c
index 4cff057..166bf4b 100644
--- a/syscall.c
+++ b/syscall.c
@@ -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')
-- 
GitLab