[PATCH 8/8] nandwrite: use common.h "errmsg_die"

Brian Norris computersforpeace at gmail.com
Mon Nov 29 03:02:02 EST 2010


errmsg_die() should be nearly the equivalent of the error message used
here. This saves a few lines.

Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 nandwrite.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/nandwrite.c b/nandwrite.c
index c409878..c51efd7 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -212,11 +212,9 @@ static void process_options(int argc, char * const argv[])
 		}
 	}
 
-	if (mtdoffset < 0) {
-		fprintf(stderr, "Can't specify a negative device offset `%lld'\n",
+	if (mtdoffset < 0)
+		errmsg_die("Can't specify a negative device offset '%lld'",
 				mtdoffset);
-		exit(EXIT_FAILURE);
-	}
 
 	if (blockalign < 0)
 		errmsg_die("Can't specify a negative blockalign '%d'",
-- 
1.7.0.4





More information about the linux-mtd mailing list