From patchwork Mon Feb 4 15:57:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Czarcinski X-Patchwork-Id: 2093261 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D690C40106 for ; Mon, 4 Feb 2013 15:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755635Ab3BDP6P (ORCPT ); Mon, 4 Feb 2013 10:58:15 -0500 Received: from eastrmfepo201.cox.net ([68.230.241.216]:52803 "EHLO eastrmfepo201.cox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755304Ab3BDP6O (ORCPT ); Mon, 4 Feb 2013 10:58:14 -0500 Received: from eastrmimpo109 ([68.230.241.222]) by eastrmfepo201.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20130204155813.ZXWP17456.eastrmfepo201.cox.net@eastrmimpo109> for ; Mon, 4 Feb 2013 10:58:13 -0500 Received: from falcon.lcl ([68.100.144.189]) by eastrmimpo109 with cox id wFy11k00b45PsQc01FyDC7; Mon, 04 Feb 2013 10:58:13 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020202.510FDA95.00C1,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=ac/jbGUt c=1 sm=1 a=xiXiwr23JuvKlkj6ngz4TA==:17 a=pqWY4DAAdoQA:10 a=103jMkqsgCkA:10 a=BIJj-m-0AAAA:8 a=AVBFacC2Fa0A:10 a=20KFwNOVAAAA:8 a=6AS1HtOrFSvgEaOqhZcA:9 a=jEp0ucaQiEUA:10 a=LUue1KWhiSUA:10 a=xiXiwr23JuvKlkj6ngz4TA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (CRAM-MD5) smtp.auth=gczarcinski@cox.net From: Gene Czarcinski To: linux-btrfs@vger.kernel.org Cc: Eric Sandeen , Gene Czarcinski Subject: [PATCH] Btrfs-progs print more informative error when we fail to open a device Date: Mon, 4 Feb 2013 10:57:57 -0500 Message-Id: <1359993477-18281-2-git-send-email-gene@czarc.net> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1359993477-18281-1-git-send-email-gene@czarc.net> References: <1359993477-18281-1-git-send-email-gene@czarc.net> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Eric Sandeen print more informative error when we fail to open a device If open() fails, we should let the user know why it failed. Signed-off-by: Eric Sandeen Signed-off-by: Gene Czarcinski --- utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c index d92f317..b560a49 100644 --- a/utils.c +++ b/utils.c @@ -1212,7 +1212,8 @@ scan_again: fd = open(fullpath, O_RDONLY); if (fd < 0) { - fprintf(stderr, "failed to read %s\n", fullpath); + fprintf(stderr, "failed to open %s: %s\n", + fullpath, strerror(errno)); continue; } ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,