summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-07-15 22:28:02 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-10-05 13:53:55 -0500
commitf66724c99a322ec147b0297cba4334c589883b47 (patch)
tree38d9a811daa7ed70bd889f353ce32010f1d3d350 /linux-user
parent999fa40e431626121cdee7d244aadfd0c8f2597b (diff)
Add new user mode option -ignore-environment
An empty environment is sometimes useful in user mode. The new option provides it for linux-user and bsd-user (darwin-user still has no environment related options). The patch also adds the documentation for other environment related options. Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 69d050f91..dbba8befe 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2790,6 +2790,12 @@ int main(int argc, char **argv, char **envp)
r = argv[optind++];
if (envlist_setenv(envlist, r) != 0)
usage();
+ } else if (!strcmp(r, "ignore-environment")) {
+ envlist_free(envlist);
+ if ((envlist = envlist_create()) == NULL) {
+ (void) fprintf(stderr, "Unable to allocate envlist\n");
+ exit(1);
+ }
} else if (!strcmp(r, "U")) {
r = argv[optind++];
if (envlist_unsetenv(envlist, r) != 0)