summaryrefslogtreecommitdiff
path: root/user/grep.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2022-09-11 13:51:11 -0400
committerFrans Kaashoek <[email protected]>2022-09-11 13:51:11 -0400
commit4b46c0c6eb464782faa36d158246ba4e3238c970 (patch)
tree5b4d3d6bae71884b607bee744e1311a115b7e4d1 /user/grep.c
parent463ae0abc3225d6e6de4a5a1ad57e64ab76b2b6f (diff)
downloadxv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.tar.gz
xv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.tar.bz2
xv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.zip
Use O_RDONLY instead of 0
Diffstat (limited to 'user/grep.c')
-rw-r--r--user/grep.c3
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);
}