summaryrefslogtreecommitdiffstats
path: root/commands/loadxy.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-09 08:05:26 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-09 09:22:14 +0200
commit3894344053adc2bf42d565670e4197316284e1a3 (patch)
tree246895813e81701c2f6e2e5bda7217521fb473af /commands/loadxy.c
parentd2a53a56b9629b90fce73d5e28e4fc3f57fa9acb (diff)
downloadbarebox-3894344053adc2bf42d565670e4197316284e1a3.tar.gz
loadx: 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/loadxy.c')
-rw-r--r--commands/loadxy.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/commands/loadxy.c b/commands/loadxy.c
index b475edf..d5cc588 100644
--- a/commands/loadxy.c
+++ b/commands/loadxy.c
@@ -144,7 +144,6 @@ static int do_loadx(int argc, char *argv[])
{
ulong offset = 0;
int load_baudrate = 0, current_baudrate, ofd, opt, rcode = 0;
- int open_mode = O_WRONLY;
char *output_file = NULL, *cname = NULL;
struct console_device *cdev = NULL;
@@ -159,9 +158,6 @@ static int do_loadx(int argc, char *argv[])
case 'o':
offset = (int)simple_strtoul(optarg, NULL, 10);
break;
- case 'c':
- open_mode |= O_CREAT;
- break;
case 't':
cname = optarg;
break;
@@ -186,7 +182,7 @@ static int do_loadx(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;
@@ -222,7 +218,6 @@ 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("-t NAME", "console name to use (default: current)")
-BAREBOX_CMD_HELP_OPT("-c", "create file if not present")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(loadx)