From patchwork Wed Oct 17 04:17:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 42A022C009A for ; Wed, 17 Oct 2012 15:19:02 +1100 (EST) Received: from localhost ([::1]:53984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5w-0004lj-3Z for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2012 00:19:00 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=gGjuHdTuOpKbpCTvtq/g2voUW8H0HpBWTawTLVdA/QY=; b=y5VIlbGxPWg4ZkxyGSrv/wggIPz6plU2e920H1BUfwrm4Yi7ql5V+z5lZLnQ3Y0S4a SfqSZ31r1cMhiKaQ6nh+0fvnCoWNo/Ed/IDvoQ4ULZnj+zjsLPMbYKTjSdRwyqGCqecn WPE3Si+3Lsx+XePbi7ieo8O+5++w3ASPuDG1LbyLrs8G4S1b0QaVzIFMaQbKW0sDF1AI hJWGNZOU3ltnO9jCj9khqf8LgIlq3uCog2I0OWKPibevUzKKwohamq7bjJlS+mX+Usp6 XvFqROrFDzN+wjXgiwJrg8LzkjqrGGWyv36iZoHbJPrp6RXo5hKKyR8gowZ36S4TaLqZ 1Cvw== Received: by 10.68.248.70 with SMTP id yk6mr34853634pbc.160.1350447519529; Tue, 16 Oct 2012 21:18:39 -0700 (PDT) Received: from pebble.twiddle.home ([101.168.58.73]) by mx.google.com with ESMTPS id iu8sm11824224pbc.71.2012.10.16.21.18.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2012 21:18:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2012 14:17:18 +1000 Message-Id: <1350447438-8603-5-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350447438-8603-1-git-send-email-rth@twiddle.net> References: <1350447438-8603-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 4/4] user: Consider symbolic links as possible directories X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)