]> git.proxmox.com Git - qemu.git/commitdiff
user: Consider symbolic links as possible directories
authorRichard Henderson <rth@twiddle.net>
Sat, 5 Jan 2013 00:39:33 +0000 (16:39 -0800)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 12 Jan 2013 12:25:22 +0000 (12:25 +0000)
Commit 2296f194dfde4c0a54f249d3fdb8c8ca21dc611b 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>
path.c

diff --git a/path.c b/path.c
index ef3f277f17ac436cbb2b37856b52ae50ae2fa2ed..4c5b0f62961284ac24bd244b94286c842d238110 100644 (file)
--- a/path.c
+++ b/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)