summaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 7add1fe3b4..1cb2a6b9b5 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -3,9 +3,6 @@
*
* Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
@@ -162,6 +159,8 @@ int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
*destfile = optarg;
break;
case 'x':
+ if (!swab)
+ return -EINVAL;
*swab = 1;
break;
default:
@@ -210,11 +209,14 @@ int memcpy_parse_options(int argc, char *argv[], int *sourcefd,
destfile = destfile ?: "/dev/mem";
*sourcefd = open_and_lseek(sourcefile, mode | O_RDONLY, src);
- if (*sourcefd < 0)
+ if (*sourcefd < 0) {
+ printf("Could not open source file \"%s\": %m\n", sourcefile);
return -1;
+ }
*destfd = open_and_lseek(destfile, mode | destmode, dest);
if (*destfd < 0) {
+ printf("Could not open destination file \"%s\": %m\n", destfile);
close(*sourcefd);
return -1;
}