Skip to contentSkip to conversation

sandbox: move add_image for env in second getopt

PATCH Applied Alexander Aring 2 participants 3 messages Oct 12, 2012 – Oct 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sandbox: move add_image for env in second getopt

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

---
 arch/sandbox/os/common.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
arch/sandbox/os/common.c +7 -5
index 0dedfe1..8c7679a 100644
@@ -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;
 		}
Signature · 7 lines
1.7.12.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 sandbox: fix malloc argument string

Fix malloc argument string.

---
 arch/sandbox/os/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sandbox/os/common.c +1 -1
index 8c7679a..db347e2 100644
@@ -403,7 +403,7 @@ static void print_usage(const char *prgname)
 "Usage: %s [OPTIONS]\n"
 "Start barebox.\n\n"
 "Options:\n\n"
-"  -m, "
+"  -m, --malloc=<size>	Start sandbox with a specified malloc-space size in bytes.\n"
 "  -i, --image=<file>   Map an image file to barebox. This option can be given\n"
 "                       multiple times. The files will show up as\n"
 "                       /dev/fd0 ... /dev/fdx under barebox.\n"
Signature · 7 lines
1.7.12.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#2 lore raw
In reply to Alexander Aring
Quoted 4 lines · Alexander Aring

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

Applied, thanks

Sascha

Quoted 43 lines
---
 arch/sandbox/os/common.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
arch/sandbox/os/common.c +7 -5
index 0dedfe1..8c7679a 100644
@@ -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;
 		}
Signature · 7 lines
1.7.12.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox