about summary refs log tree commit diff
path: root/src/libstd/sys/wasm
diff options
context:
space:
mode:
authorDiggory Blake <diggsey@googlemail.com>2017-12-17 15:21:47 +0000
committerDiggory Blake <diggsey@googlemail.com>2017-12-24 14:24:31 +0000
commitccc91d7b4873a50678b3f65c895290915c54f6f5 (patch)
tree5884d3c794a88178b6853df2dde3bcb3ee67de1b /src/libstd/sys/wasm
parentb058dc0107b734b0a1a664ca0209366bb59eb3e9 (diff)
Capture environment at spawn
Diffstat (limited to 'src/libstd/sys/wasm')
-rw-r--r--src/libstd/sys/wasm/process.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libstd/sys/wasm/process.rs b/src/libstd/sys/wasm/process.rs
index 4febe8a1463..f3f5de350f1 100644
--- a/src/libstd/sys/wasm/process.rs
+++ b/src/libstd/sys/wasm/process.rs
@@ -14,12 +14,14 @@ use io;
 use sys::fs::File;
 use sys::pipe::AnonPipe;
 use sys::{unsupported, Void};
+use sys_common::process::{CommandEnv, DefaultEnvKey};
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
 ////////////////////////////////////////////////////////////////////////////////
 
 pub struct Command {
+    env: CommandEnv<DefaultEnvKey>
 }
 
 // passed back to std::process with the pipes connected to the child, if any
@@ -38,19 +40,16 @@ pub enum Stdio {
 
 impl Command {
     pub fn new(_program: &OsStr) -> Command {
-        Command {}
+        Command {
+            env: Default::default()
+        }
     }
 
     pub fn arg(&mut self, _arg: &OsStr) {
     }
 
-    pub fn env(&mut self, _key: &OsStr, _val: &OsStr) {
-    }
-
-    pub fn env_remove(&mut self, _key: &OsStr) {
-    }
-
-    pub fn env_clear(&mut self) {
+    pub fn env_mut(&mut self) -> &mut CommandEnv<DefaultEnvKey> {
+        &mut self.env
     }
 
     pub fn cwd(&mut self, _dir: &OsStr) {