Get rid of unnecessary barrier. Improve comment.
[pintos-anon] / grading / filesys / grow-two-files.c
index 8809c608aa59c22bd7a21096b581ddfe548d3c5c..e4b890464a67402c3f69230fae62e6045c2ff2bf 100644 (file)
@@ -24,8 +24,8 @@ write_some_bytes (const char *filename, int fd, const char *buf, size_t *ofs)
     }
 }
 
-int
-main (void) 
+void
+test_main (void) 
 {
   int fd_a, fd_b;
   size_t ofs_a, ofs_b;
@@ -34,11 +34,11 @@ main (void)
   random_bytes (buf_a, sizeof buf_a);
   random_bytes (buf_b, sizeof buf_b);
 
-  check (create ("a", 0), "create \"a\"");
-  check (create ("b", 0), "create \"b\"");
+  CHECK (create ("a", 0), "create \"a\"");
+  CHECK (create ("b", 0), "create \"b\"");
 
-  check ((fd_a = open ("a")) > 1, "open \"a\"");
-  check ((fd_b = open ("b")) > 1, "open \"b\"");
+  CHECK ((fd_a = open ("a")) > 1, "open \"a\"");
+  CHECK ((fd_b = open ("b")) > 1, "open \"b\"");
 
   msg ("write \"a\" and \"b\" alternately");
   while (ofs_a < FILE_SIZE || ofs_b < FILE_SIZE) 
@@ -55,6 +55,4 @@ main (void)
 
   check_file ("a", buf_a, FILE_SIZE);
   check_file ("b", buf_b, FILE_SIZE);
-
-  return 0;
 }