summaryrefslogtreecommitdiff
path: root/user/grep.c
diff options
context:
space:
mode:
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);
}