mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@googlemail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] sandbox: move add_image for env in second getopt
Date: Fri, 12 Oct 2012 19:38:12 +0200	[thread overview]
Message-ID: <1350063493-3782-1-git-send-email-alex.aring@gmail.com> (raw)

Function add_image needs a allocated malloc space.
This is only available in the second getopt loop.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 arch/sandbox/os/common.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 0dedfe1..8c7679a 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -311,11 +311,6 @@ int main(int argc, char *argv[])
 		case 'i':
 			break;
 		case 'e':
-			sprintf(str, "env%d", envno);
-			ret = add_image(optarg, str);
-			if (ret)
-				exit(1);
-			envno++;
 			break;
 		case 'O':
 			fd = open(optarg, O_WRONLY);
@@ -376,6 +371,13 @@ int main(int argc, char *argv[])
 				exit(1);
 			fdno++;
 			break;
+		case 'e':
+			sprintf(str, "env%d", envno);
+			ret = add_image(optarg, str);
+			if (ret)
+				exit(1);
+			envno++;
+			break;
 		default:
 			break;
 		}
-- 
1.7.12.2


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

             reply	other threads:[~2012-10-12 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 17:38 Alexander Aring [this message]
2012-10-12 17:38 ` [PATCH 2/2] sandbox: fix malloc argument string Alexander Aring
2012-10-13 12:29 ` [PATCH 1/2] sandbox: move add_image for env in second getopt 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=1350063493-3782-1-git-send-email-alex.aring@gmail.com \
    --to=alex.aring@googlemail.com \
    --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