summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2020-11-19 16:48:41 -0500
committerRobert Morris <[email protected]>2020-11-19 16:48:41 -0500
commit6e3f75c2aa670bc0d47928cd48408b81e5bd758d (patch)
tree11c1ef9b25b335bf430ac206ef7da389deebb0eb
parent231c08dc5e5e39a6fafda832e6935beb38ef3887 (diff)
downloadxv6-labs-6e3f75c2aa670bc0d47928cd48408b81e5bd758d.tar.gz
xv6-labs-6e3f75c2aa670bc0d47928cd48408b81e5bd758d.tar.bz2
xv6-labs-6e3f75c2aa670bc0d47928cd48408b81e5bd758d.zip
suppress an incorrect error message in grind
-rw-r--r--user/grind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/user/grind.c b/user/grind.c
index 85899f5..5cd89f4 100644
--- a/user/grind.c
+++ b/user/grind.c
@@ -277,14 +277,15 @@ go(int which_child)
close(aa[0]);
close(aa[1]);
close(bb[1]);
- char buf[3] = { 0, 0, 0 };
+ char buf[4] = { 0, 0, 0, 0 };
read(bb[0], buf+0, 1);
read(bb[0], buf+1, 1);
+ read(bb[0], buf+2, 1);
close(bb[0]);
int st1, st2;
wait(&st1);
wait(&st2);
- if(st1 != 0 || st2 != 0 || strcmp(buf, "hi") != 0){
+ if(st1 != 0 || st2 != 0 || strcmp(buf, "hi\n") != 0){
printf("grind: exec pipeline failed %d %d \"%s\"\n", st1, st2, buf);
exit(1);
}