X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/986ce23ace2f7875a1a561bd947f435a7594146c..7b8a1bcad75628f9add4590db2bb9b8e418ee8eb:/lunaix-os/kernel/fs/path_walk.c diff --git a/lunaix-os/kernel/fs/path_walk.c b/lunaix-os/kernel/fs/path_walk.c index 07edfc7..e1b1157 100644 --- a/lunaix-os/kernel/fs/path_walk.c +++ b/lunaix-os/kernel/fs/path_walk.c @@ -119,7 +119,7 @@ __vfs_walk(struct v_dnode* start, current_level = dnode; current_inode = current_level->inode; - if ((current_inode->itype & VFS_IFSYMLINK) && + if ((current_inode->itype & F_MSLNK) && !(walk_options & VFS_WALK_NOFOLLOW)) { const char* link; @@ -173,6 +173,11 @@ vfs_walk(struct v_dnode* start, struct hstr* component, int options) { + if (!path) { + *dentry = NULL; + return 0; + } + // allocate a file name stack for path walking and recursion to resolve // symlink char* name_buffer = valloc(2048);