diff options
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; } |