diff options
author | Frans Kaashoek <[email protected]> | 2022-09-11 13:51:11 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2022-09-11 13:51:11 -0400 |
commit | 4b46c0c6eb464782faa36d158246ba4e3238c970 (patch) | |
tree | 5b4d3d6bae71884b607bee744e1311a115b7e4d1 /user/ls.c | |
parent | 463ae0abc3225d6e6de4a5a1ad57e64ab76b2b6f (diff) | |
download | xv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.tar.gz xv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.tar.bz2 xv6-labs-4b46c0c6eb464782faa36d158246ba4e3238c970.zip |
Use O_RDONLY instead of 0
Diffstat (limited to 'user/ls.c')
-rw-r--r-- | user/ls.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2,6 +2,7 @@ #include "kernel/stat.h" #include "user/user.h" #include "kernel/fs.h" +#include "kernel/fcntl.h" char* fmtname(char *path) @@ -30,7 +31,7 @@ ls(char *path) struct dirent de; struct stat st; - if((fd = open(path, 0)) < 0){ + if((fd = open(path, O_RDONLY)) < 0){ fprintf(2, "ls: cannot open %s\n", path); return; } |