Reduce usage of LP_CLONE_FDIO_CWD

To pass a CWD to a child through launchpad, simply set
the PWD environment variable, and the child will open
their CWD relative to their root handle when they initialize.

Change-Id: I24cd01c05e705c5a0ec2dfbaae4dbe8de42d7ed4
Reviewed-on: https://dart-review.googlesource.com/15421
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This commit is contained in:
Sean Klein 2017-10-20 03:50:27 +00:00 committed by commit-bot@chromium.org
parent 2747dae5d7
commit e4b72146ca

View file

@ -660,7 +660,7 @@ class ProcessStarter {
launchpad_create(ZX_HANDLE_INVALID, program_arguments_[0], &lp);
launchpad_set_args(lp, program_arguments_count_, program_arguments_);
launchpad_set_environ(lp, program_environment_);
launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_FDIO_CWD);
launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE);
launchpad_add_pipe(lp, &write_out_, 0);
launchpad_add_pipe(lp, &read_in_, 1);
launchpad_add_pipe(lp, &read_err_, 2);