From a71f0ce8c5f80757096f6e4d0ebca27ccbe14da9 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 6 Feb 2008 18:59:15 +0200 Subject: ubi-tools: improve printing macros Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubicrc32.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ubi-utils/src/ubicrc32.c') diff --git a/ubi-utils/src/ubicrc32.c b/ubi-utils/src/ubicrc32.c index 8064439..5c7a8ba 100644 --- a/ubi-utils/src/ubicrc32.c +++ b/ubi-utils/src/ubicrc32.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include "crc32.h" @@ -76,8 +75,7 @@ static int parse_opt(int argc, char * const argv[]) exit(EXIT_SUCCESS); case ':': - errmsg("parameter is missing"); - return -1; + return errmsg("parameter is missing"); default: fprintf(stderr, "Use -h for help\n"); @@ -97,11 +95,8 @@ int main(int argc, char * const argv[]) if (argc > 1) { fp = fopen(argv[1], "r"); - if (!fp) { - errmsg("cannot open \"%s\"", argv[1]); - perror("fopen"); - return -1; - } + if (!fp) + return sys_errmsg("cannot open \"%s\"", argv[1]); } else fp = stdin; @@ -114,8 +109,7 @@ int main(int argc, char * const argv[]) read = fread(buf, 1, BUFSIZE, fp); if (ferror(fp)) { - errmsg("cannot read input file"); - perror("fread"); + sys_errmsg("cannot read input file"); err = -1; goto out_close; } -- cgit v1.2.3