From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5d-0004cn-1f for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOL5c-000181-16 for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:40 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:59325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5b-00017F-Qk for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:39 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so6699043pbb.4 for ; Tue, 16 Oct 2012 21:18:39 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Wed, 17 Oct 2012 14:17:18 +1000 Message-Id: <1350447438-8603-5-git-send-email-rth@twiddle.net> In-Reply-To: <1350447438-8603-1-git-send-email-rth@twiddle.net> References: <1350447438-8603-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 4/4] user: Consider symbolic links as possible directories List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio 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 --- path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/path.c b/path.c index ef3f277..4c5b0f6 100644 --- 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) -- 1.7.11.7