diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-09 08:07:20 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-09 09:22:14 +0200 |
commit | b4d5c8a03917decfe9a6c2f27d1a4e0fddfc07c3 (patch) | |
tree | ef76bec5ba8ccdce133c05dcf815fa807e6d90f7 /commands | |
parent | e8b94fdfb661fa6b77fdbe6d3ff657c8fa3fbb83 (diff) | |
download | barebox-b4d5c8a03917decfe9a6c2f27d1a4e0fddfc07c3.tar.gz barebox-b4d5c8a03917decfe9a6c2f27d1a4e0fddfc07c3.tar.xz |
loadb: ignore -c option
And always create the file if necessary. No need to have an extra flag for
this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/loadb.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/commands/loadb.c b/commands/loadb.c index acc3cd4a51..be5830da32 100644 --- a/commands/loadb.c +++ b/commands/loadb.c @@ -606,7 +606,6 @@ static int do_load_serial_bin(int argc, char *argv[]) int load_baudrate = 0, current_baudrate; int rcode = 0, ret; int opt; - int open_mode = O_WRONLY; char *output_file = NULL; struct console_device *cdev = NULL; @@ -621,9 +620,6 @@ static int do_load_serial_bin(int argc, char *argv[]) case 'o': offset = (int)simple_strtoul(optarg, NULL, 10); break; - case 'c': - open_mode |= O_CREAT; - break; default: perror(argv[0]); return 1; @@ -644,7 +640,7 @@ static int do_load_serial_bin(int argc, char *argv[]) output_file = DEF_FILE; /* File should exist */ - ofd = open(output_file, open_mode); + ofd = open(output_file, O_WRONLY | O_CREAT); if (ofd < 0) { perror(argv[0]); return 3; @@ -688,7 +684,6 @@ BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default image.bin") BAREBOX_CMD_HELP_OPT("-o OFFS", "destination file OFFSet (default 0)") BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate") -BAREBOX_CMD_HELP_OPT("-c", "create file if not present") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(loadb) |