transfer environment to child process

This commit is contained in:
Kelvin Sherlock
2016-02-03 15:06:48 -05:00
parent 2fda21a349
commit e3ed9dec46
2 changed files with 10 additions and 1 deletions

View File

@@ -67,7 +67,14 @@ namespace {
if (pid == 0) {
// also export environment...
// export environment...
for (const auto &kv : env) {
if (kv.second) { // exported
std::string name = "mpw$" + kv.first;
setenv(name.c_str(), kv.second.c_str(), 1);
}
}
// handle any indirection...
fds.dup();