summaryrefslogtreecommitdiff
path: root/ubi-utils/src/ubicrc32.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-06 18:59:15 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-06 18:59:15 +0200
commita71f0ce8c5f80757096f6e4d0ebca27ccbe14da9 (patch)
tree07645e323044fcfb331df157a80a84b624cdab51 /ubi-utils/src/ubicrc32.c
parentf3d507be006c46870818c549b8f7dc0b4daccf03 (diff)
ubi-tools: improve printing macros
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/ubicrc32.c')
-rw-r--r--ubi-utils/src/ubicrc32.c14
1 files changed, 4 insertions, 10 deletions
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 <getopt.h>
#include <argp.h>
#include <unistd.h>
-#include <errno.h>
#include <mtd/ubi-header.h>
#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;
}