File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/libstd/sys/unix/process Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,10 @@ impl Command {
4848 use crate :: sys:: process:: zircon:: * ;
4949
5050 let envp = match maybe_envp {
51- Some ( envp) => envp. as_ptr ( ) ,
51+ // None means to clone the current environment, which is done in the
52+ // flags below.
5253 None => ptr:: null ( ) ,
54+ Some ( envp) => envp. as_ptr ( ) ,
5355 } ;
5456
5557 let make_action = |local_io : & ChildStdio , target_fd| -> io:: Result < fdio_spawn_action_t > {
@@ -104,7 +106,8 @@ impl Command {
104106 let mut process_handle: zx_handle_t = 0 ;
105107 zx_cvt ( fdio_spawn_etc (
106108 ZX_HANDLE_INVALID ,
107- FDIO_SPAWN_CLONE_JOB | FDIO_SPAWN_CLONE_LDSVC | FDIO_SPAWN_CLONE_NAMESPACE ,
109+ FDIO_SPAWN_CLONE_JOB | FDIO_SPAWN_CLONE_LDSVC | FDIO_SPAWN_CLONE_NAMESPACE
110+ | FDIO_SPAWN_CLONE_ENVIRON , // this is ignored when envp is non-null
108111 self . get_argv ( ) [ 0 ] , self . get_argv ( ) . as_ptr ( ) , envp,
109112 actions. len ( ) as size_t , actions. as_ptr ( ) ,
110113 & mut process_handle,
You can’t perform that action at this time.
0 commit comments