From patchwork Mon Sep 8 06:45:36 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 202 Return-Path: X-Original-To: patchwork@ozlabs.org Delivered-To: patchwork@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F2B02DDE1D for ; Mon, 8 Sep 2008 16:45:47 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KcaVI-0005I1-KQ; Mon, 08 Sep 2008 06:45:40 +0000 Received: from relay02.pair.com ([209.68.5.16]) by bombadil.infradead.org with smtp (Exim 4.68 #1 (Red Hat Linux)) id 1KcaVG-000548-MC for linux-mtd@lists.infradead.org; Mon, 08 Sep 2008 06:45:38 +0000 Received: (qmail 89176 invoked by uid 0); 8 Sep 2008 06:45:37 -0000 Received: from unknown (HELO localhost.localdomain) (unknown) by unknown with SMTP; 8 Sep 2008 06:45:37 -0000 X-pair-Authenticated: 66.134.71.115 From: Grant Erickson To: linux-mtd@lists.infradead.org Subject: [PATCH 3/6] [MTD-UTILS] nanddump: Pass Real Names as Arguments to perror Date: Sun, 7 Sep 2008 23:45:36 -0700 Message-Id: <1220856336-22772-1-git-send-email-gerickson@nuovations.com> X-Mailer: git-send-email 1.6.0.1 Organization: Nuovation System Designs, LLC X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org Pass the MTD device node and dump file name as arguments to perror rather than more ambigous, static messages on open failures. Signed-off-by: Grant Erickson diff --git a/nanddump.c b/nanddump.c index 8c7175c..168fbbb 100644 --- a/nanddump.c +++ b/nanddump.c @@ -182,7 +182,7 @@ int main(int argc, char * const argv[]) /* Open MTD device */ if ((fd = open(mtddev, O_RDONLY)) == -1) { - perror("open flash"); + perror(mtddev); exit (EXIT_FAILURE); } @@ -249,7 +249,7 @@ int main(int argc, char * const argv[]) if (!dumpfile) { ofd = STDOUT_FILENO; } else if ((ofd = open(dumpfile, O_WRONLY | O_TRUNC | O_CREAT, 0644))== -1) { - perror ("open outfile"); + perror (dumpfile); close(fd); exit(EXIT_FAILURE); }