git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ld-tool portability fix: MacOS build experience
[lunaix-os.git]
/
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 f3dc8dd1bae87941bc926b095c7c817eaf26c569..e1b11578145ed1f47d1ddd12cdf7246cf8207247 100644
(file)
--- 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;
current_level = dnode;
current_inode = current_level->inode;
- if ((current_inode->itype &
VFS_IFSYMLI
NK) &&
+ if ((current_inode->itype &
F_MSL
NK) &&
!(walk_options & VFS_WALK_NOFOLLOW)) {
const char* link;
!(walk_options & VFS_WALK_NOFOLLOW)) {
const char* link;
@@
-148,8
+148,6
@@
__vfs_walk(struct v_dnode* start,
goto error;
}
goto error;
}
- // reposition the resolved subtree pointed by symlink
- // vfs_dcache_rehash(current_level->parent, dnode);
current_level = dnode;
current_inode = dnode->inode;
}
current_level = dnode;
current_inode = dnode->inode;
}
@@
-175,6
+173,11
@@
vfs_walk(struct v_dnode* start,
struct hstr* component,
int options)
{
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);
// allocate a file name stack for path walking and recursion to resolve
// symlink
char* name_buffer = valloc(2048);