From 8b8dcd3ea6b1fa82be3092ae70750258f1bfaca6 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 9 Aug 2018 10:33:13 +0200 Subject: commands: teach commands that write to files to also create them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows to use the adapted commands on non-existing files which failed before with open: No such file or directory Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- commands/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands/mm.c') diff --git a/commands/mm.c b/commands/mm.c index 6d2a887892..c7f62fca54 100644 --- a/commands/mm.c +++ b/commands/mm.c @@ -53,7 +53,7 @@ static int do_mem_mm(int argc, char *argv[]) value = simple_strtoull(argv[optind++], NULL, 0); mask = simple_strtoull(argv[optind++], NULL, 0); - fd = open_and_lseek(filename, mode | O_RDWR, adr); + fd = open_and_lseek(filename, mode | O_RDWR | O_CREAT, adr); if (fd < 0) return 1; -- cgit v1.2.3