projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Talk about write() to stdout more.
[pintos-anon]
/
grading
/
filesys
/
child-syn-rw.c
diff --git
a/grading/filesys/child-syn-rw.c
b/grading/filesys/child-syn-rw.c
index 64e93c7a8a3d873582cc2a4fd18be74fd89fb0c3..7f0137aa94086782bb37e39eba4afd4499812df2 100644
(file)
--- a/
grading/filesys/child-syn-rw.c
+++ b/
grading/filesys/child-syn-rw.c
@@
-20,18
+20,18
@@
main (int argc, const char *argv[])
quiet = true;
quiet = true;
-
check
(argc == 2, "argc must be 2, actually %d", argc);
+
CHECK
(argc == 2, "argc must be 2, actually %d", argc);
child_idx = atoi (argv[1]);
random_init (0);
random_bytes (buf1, sizeof buf1);
child_idx = atoi (argv[1]);
random_init (0);
random_bytes (buf1, sizeof buf1);
-
check
((fd = open (filename)) > 1, "open \"%s\"", filename);
+
CHECK
((fd = open (filename)) > 1, "open \"%s\"", filename);
ofs = 0;
while (ofs < sizeof buf2)
{
int bytes_read = read (fd, buf2 + ofs, sizeof buf2 - ofs);
ofs = 0;
while (ofs < sizeof buf2)
{
int bytes_read = read (fd, buf2 + ofs, sizeof buf2 - ofs);
-
check
(bytes_read >= -1 && bytes_read <= (int) (sizeof buf2 - ofs),
+
CHECK
(bytes_read >= -1 && bytes_read <= (int) (sizeof buf2 - ofs),
"%zu-byte read on \"%s\" returned invalid value of %d",
sizeof buf2 - ofs, filename, bytes_read);
if (bytes_read > 0)
"%zu-byte read on \"%s\" returned invalid value of %d",
sizeof buf2 - ofs, filename, bytes_read);
if (bytes_read > 0)