diff options
| author | Frans Kaashoek <kaashoek@mit.edu> | 2022-09-14 11:44:10 -0400 |
|---|---|---|
| committer | Frans Kaashoek <kaashoek@mit.edu> | 2022-09-14 11:44:10 -0400 |
| commit | 5bf29abfc84c057293e55be5cd5a136b7f993fdb (patch) | |
| tree | 76a1ad1e3f0dc56c0d2c685069d74e1bd6f0f9af /user/grep.c | |
| parent | 97223ed907bf489fd051742b0e722b1a4eb5912f (diff) | |
| parent | 4b46c0c6eb464782faa36d158246ba4e3238c970 (diff) | |
| download | xv6-labs-2022-5bf29abfc84c057293e55be5cd5a136b7f993fdb.tar.xz xv6-labs-2022-5bf29abfc84c057293e55be5cd5a136b7f993fdb.zip | |
Merge branch 'riscv' into syscall
Diffstat (limited to 'user/grep.c')
| -rw-r--r-- | user/grep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/user/grep.c b/user/grep.c index 2315a0c..6c33766 100644 --- a/user/grep.c +++ b/user/grep.c @@ -2,6 +2,7 @@ #include "kernel/types.h" #include "kernel/stat.h" +#include "kernel/fcntl.h" #include "user/user.h" char buf[1024]; @@ -51,7 +52,7 @@ main(int argc, char *argv[]) } for(i = 2; i < argc; i++){ - if((fd = open(argv[i], 0)) < 0){ + if((fd = open(argv[i], O_RDONLY)) < 0){ printf("grep: cannot open %s\n", argv[i]); exit(1); } |
