diff options
Diffstat (limited to 'core/fs/chdir.c')
-rw-r--r-- | core/fs/chdir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fs/chdir.c b/core/fs/chdir.c index 5d3a545f..276ea11c 100644 --- a/core/fs/chdir.c +++ b/core/fs/chdir.c @@ -2,6 +2,7 @@ #include <stdbool.h> #include <string.h> #include <dprintf.h> +#include <fcntl.h> #include "fs.h" #include "cache.h" @@ -65,7 +66,7 @@ __export size_t realpath(char *dst, const char *src, size_t bufsize) if (this_fs->fs_ops->realpath) { s = this_fs->fs_ops->realpath(this_fs, dst, src, bufsize); } else { - rv = searchdir(src); + rv = searchdir(src, O_RDONLY); if (rv < 0) { dprintf("realpath: searchpath failure\n"); return -1; @@ -97,7 +98,7 @@ __export int chdir(const char *src) return this_fs->fs_ops->chdir(this_fs, src); /* Otherwise it is a "conventional filesystem" */ - rv = searchdir(src); + rv = searchdir(src, O_RDONLY|O_DIRECTORY); if (rv < 0) return rv; |