diff options
Diffstat (limited to 'commands/memset.c')
-rw-r--r-- | commands/memset.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/commands/memset.c b/commands/memset.c index b0770159f8..1139691f2f 100644 --- a/commands/memset.c +++ b/commands/memset.c @@ -1,19 +1,5 @@ -/* - * Copyright (c) 2011 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: © 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix /* * Memory Functions @@ -55,8 +41,10 @@ static int do_memset(int argc, char *argv[]) n = strtoull_suffix(argv[optind + 2], NULL, 0); fd = open_and_lseek(file, mode | O_WRONLY | O_CREAT, s); - if (fd < 0) + if (fd < 0) { + printf("Could not open \"%s\": %m\n", file); return 1; + } buf = xmalloc(RW_BUF_SIZE); memset(buf, c, RW_BUF_SIZE); @@ -98,7 +86,7 @@ BAREBOX_CMD_HELP_END BAREBOX_CMD_START(memset) .cmd = do_memset, BAREBOX_CMD_DESC("memory fill") - BAREBOX_CMD_OPTS("[-bwld] ADDR DATA COUNT") + BAREBOX_CMD_OPTS("[-bwlq [-d FILE] ADDR DATA COUNT") BAREBOX_CMD_GROUP(CMD_GRP_MEM) BAREBOX_CMD_HELP(cmd_memset_help) BAREBOX_CMD_END |