user: Consider symbolic links as possible directories
Commit 2296f194df
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: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
d2565875ec
commit
338d80dd35
5
path.c
5
path.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user