From patchwork Tue Jul 21 09:22:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joao Marcos Costa X-Patchwork-Id: 1332878 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9tSr0hjlz9sQt for ; Tue, 21 Jul 2020 19:23:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A408081F53; Tue, 21 Jul 2020 11:23:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6740F81F2C; Tue, 21 Jul 2020 11:23:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A14D781EF5 for ; Tue, 21 Jul 2020 11:23:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=joaomarcos.costa@bootlin.com Received: from localhost.localdomain (eth-east-parth2-46-193-64-106.wb.wifirst.net [46.193.64.106]) (Authenticated sender: joaomarcos.costa@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPA id BA96F240019; Tue, 21 Jul 2020 09:23:02 +0000 (UTC) From: Joao Marcos Costa To: u-boot@lists.denx.de Cc: joaomarcos.costa@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com Subject: [PATCH v3 5/5] fs/fs.c: add symbolic link case to fs_ls_generic() Date: Tue, 21 Jul 2020 11:22:59 +0200 Message-Id: <20200721092259.26916-6-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721092259.26916-1-joaomarcos.costa@bootlin.com> References: <20200721092259.26916-1-joaomarcos.costa@bootlin.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Adds an 'else if' statement inside the loop to check for symbolic links. Signed-off-by: Joao Marcos Costa --- Changes in v3: - No changes since v2. Changes in v2: - This patch was added in v2 and did not exist in the last version. fs/fs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 5b31a369f7..17e4bc33f7 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -59,6 +59,9 @@ static int fs_ls_generic(const char *dirname) if (dent->type == FS_DT_DIR) { printf(" %s/\n", dent->name); ndirs++; + } else if (dent->type == FS_DT_LNK) { + printf(" %s\n", dent->name); + nfiles++; } else { printf(" %8lld %s\n", dent->size, dent->name); nfiles++;