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 {
48
48
use crate :: sys:: process:: zircon:: * ;
49
49
50
50
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.
52
53
None => ptr:: null ( ) ,
54
+ Some ( envp) => envp. as_ptr ( ) ,
53
55
} ;
54
56
55
57
let make_action = |local_io : & ChildStdio , target_fd| -> io:: Result < fdio_spawn_action_t > {
@@ -104,7 +106,8 @@ impl Command {
104
106
let mut process_handle: zx_handle_t = 0 ;
105
107
zx_cvt ( fdio_spawn_etc (
106
108
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
108
111
self . get_argv ( ) [ 0 ] , self . get_argv ( ) . as_ptr ( ) , envp,
109
112
actions. len ( ) as size_t , actions. as_ptr ( ) ,
110
113
& mut process_handle,
You can’t perform that action at this time.
0 commit comments