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
refactor: add user space printf.
[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 0ffbabb84bb36fe1b763a6a2a23d6a69f9fffc41..ea5b1c59b4aa5da7e54d59d467d8875025ac632c 100644
(file)
--- a/
lunaix-os/kernel/fs/path_walk.c
+++ b/
lunaix-os/kernel/fs/path_walk.c
@@
-21,7
+21,7
@@
__vfs_walk(struct v_dnode* start,
int i = 0, j = 0;
if (depth >= VFS_SYMLINK_DEPTH) {
int i = 0, j = 0;
if (depth >= VFS_SYMLINK_DEPTH) {
- return E
NAMETOOLONG
;
+ return E
LOOP
;
}
if (path[0] == VFS_PATH_DELIM || !start) {
}
if (path[0] == VFS_PATH_DELIM || !start) {
@@
-36,6
+36,8
@@
__vfs_walk(struct v_dnode* start,
i++;
}
i++;
}
+ assert(start);
+
struct v_dnode* dnode;
struct v_inode* current_inode;
struct v_dnode* current_level = start;
struct v_dnode* dnode;
struct v_inode* current_inode;
struct v_dnode* current_level = start;
@@
-43,7
+45,7
@@
__vfs_walk(struct v_dnode* start,
struct hstr name = HSTR(fname_buffer, 0);
char current = path[i++], lookahead;
struct hstr name = HSTR(fname_buffer, 0);
char current = path[i++], lookahead;
- while (current
&& current_level
) {
+ while (current) {
lookahead = path[i++];
if (current != VFS_PATH_DELIM) {
if (j >= VFS_NAME_MAXLEN - 1) {
lookahead = path[i++];
if (current != VFS_PATH_DELIM) {
if (j >= VFS_NAME_MAXLEN - 1) {