提交 338d80dd 编写于 作者: R Richard Henderson 提交者: Blue Swirl

user: Consider symbolic links as possible directories

Commit 2296f194 reduced the number
of syscalls performed during user emulation startup, but failed to
consider the use of symbolic links in creating directory structures.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 d2565875
......@@ -58,9 +58,10 @@ static struct pathelem *new_entry(const char *root,
#define streq(a,b) (strcmp((a), (b)) == 0)
/* Not all systems provide this feature */
#if defined(DT_DIR) && defined(DT_UNKNOWN)
#if defined(DT_DIR) && defined(DT_UNKNOWN) && defined(DT_LNK)
# define dirent_type(dirent) ((dirent)->d_type)
# define is_dir_maybe(type) ((type) == DT_DIR || (type) == DT_UNKNOWN)
# define is_dir_maybe(type) \
((type) == DT_DIR || (type) == DT_UNKNOWN || (type) == DT_LNK)
#else
# define dirent_type(dirent) (1)
# define is_dir_maybe(type) (type)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册