From patchwork Thu Jul 24 03:27:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 4614221 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E243C0514 for ; Thu, 24 Jul 2014 03:33:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A158201D3 for ; Thu, 24 Jul 2014 03:33:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9666A201CE for ; Thu, 24 Jul 2014 03:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758617AbaGXDdR (ORCPT ); Wed, 23 Jul 2014 23:33:17 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:18381 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1758463AbaGXDdQ convert rfc822-to-8bit (ORCPT ); Wed, 23 Jul 2014 23:33:16 -0400 X-IronPort-AV: E=Sophos;i="5.00,931,1396972800"; d="scan'208";a="33711237" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 24 Jul 2014 11:30:28 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s6O3XD8T017254 for ; Thu, 24 Jul 2014 11:33:13 +0800 Received: from localhost.localdomain (10.167.226.111) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 24 Jul 2014 11:33:26 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH v2 2/3] btrfs-progs: output the correct path when fi-usage failed Date: Thu, 24 Jul 2014 11:27:28 +0800 Message-ID: <1406172448-11454-1-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1406172114-10793-2-git-send-email-guihc.fnst@cn.fujitsu.com> References: <1406172114-10793-2-git-send-email-guihc.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.111] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When we exec the following cmd: # btrfs file usage -t <-- an invalid path output: # ERROR? can't access '-t' should be: # ERROR: can't access 'path' Just replace the static 'argv[1]' with 'argv[i]'. Signed-off-by: Gui Hecheng --- changelog v1->v2: add missing signoff-by --- cmds-fi-disk_usage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c index 78dc414..1f4c88e 100644 --- a/cmds-fi-disk_usage.c +++ b/cmds-fi-disk_usage.c @@ -835,7 +835,7 @@ int cmd_filesystem_usage(int argc, char **argv) fd = open_file_or_dir(argv[i], &dirstream); if (fd < 0) { fprintf(stderr, "ERROR: can't access '%s'\n", - argv[1]); + argv[i]); ret = 1; goto out; }