summaryrefslogtreecommitdiffstats
path: root/commands/memcmp.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-07-09 00:22:53 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-09 11:38:10 +0200
commitaa8a42ac0a259187c88e8a4aca5f3d4f4f4b753a (patch)
tree5537c2f3010ef8f7c78b0380cfbc1b64cbced9a4 /commands/memcmp.c
parente7c33540d0c092c28b227d4b7602cef8ab203ef3 (diff)
downloadbarebox-aa8a42ac0a259187c88e8a4aca5f3d4f4f4b753a.tar.gz
barebox-aa8a42ac0a259187c88e8a4aca5f3d4f4f4b753a.tar.xz
lib: Add missing arguments to memcpy_parse_options()
Memcpy use-case differs from that of memcmp in default access type and destination file mode. This was missed in original commit that introduced memcpy_parse_options(). Add said parameters to memcpy_parse_options(), so the can be correctly specified depending on the use-case. Fixes: ddf4cca339 ("commands: Introduce memcpy_parse_options()") Reported-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/memcmp.c')
-rw-r--r--commands/memcmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/memcmp.c b/commands/memcmp.c
index d1c4f5205d..76fbe078f0 100644
--- a/commands/memcmp.c
+++ b/commands/memcmp.c
@@ -42,7 +42,8 @@ static int do_memcmp(int argc, char *argv[])
int ret = 1;
int offset = 0;
- if (memcpy_parse_options(argc, argv, &sourcefd, &destfd, &count) < 0)
+ if (memcpy_parse_options(argc, argv, &sourcefd, &destfd, &count,
+ O_RWSIZE_1, O_RDONLY) < 0)
return 1;
buf = xmalloc(RW_BUF_SIZE + RW_BUF_SIZE);