mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 08/12] loadx: ignore -c option
Date: Tue,  9 Jun 2015 08:21:11 +0200	[thread overview]
Message-ID: <1433830875-31119-9-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1433830875-31119-1-git-send-email-s.hauer@pengutronix.de>

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>
---
 commands/loadxy.c | 7 +------
 1 file changed, 1 insertion(+), 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)
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-06-09  6:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  6:21 Add functions for (de)activating consoles and for setting baudrate Sascha Hauer
2015-06-09  6:21 ` [PATCH 01/12] console: Add functions to get/set active state of console Sascha Hauer
2015-06-09  6:21 ` [PATCH 02/12] console: Add functions to get/set baudrate Sascha Hauer
2015-06-09  6:21 ` [PATCH 03/12] console: Add console_get_by_name Sascha Hauer
2015-06-09  6:21 ` [PATCH 04/12] console: When switching baudrate print console name Sascha Hauer
2015-06-09  6:21 ` [PATCH 05/12] usb: gadget: serial: Use console_set_active to activate console Sascha Hauer
2015-06-09  6:21 ` [PATCH 06/12] loadxy: Use console_get_by_name Sascha Hauer
2015-06-09  6:21 ` [PATCH 07/12] loadxy: use console_get_baudrate Sascha Hauer
2015-06-09  6:21 ` Sascha Hauer [this message]
2015-06-09  6:21 ` [PATCH 09/12] loadxy: use console_set_baudrate Sascha Hauer
2015-06-09  6:21 ` [PATCH 10/12] loadb: use console_get_baudrate Sascha Hauer
2015-06-09  6:21 ` [PATCH 11/12] loadb: Use console_set_baudrate Sascha Hauer
2015-06-09  6:21 ` [PATCH 12/12] loadb: ignore -c option Sascha Hauer
2015-06-09  7:26 ` Add functions for (de)activating consoles and for setting baudrate Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433830875-31119-9-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox