mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2025-02-06 09:30:14 +00:00
transfer environment to child process
This commit is contained in:
parent
2fda21a349
commit
e3ed9dec46
@ -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();
|
||||
|
@ -17,6 +17,8 @@ public:
|
||||
operator const std::string&() const { return value; }
|
||||
operator std::string&() { return value; }
|
||||
|
||||
const char *c_str() const { return value.c_str(); }
|
||||
|
||||
EnvironmentEntry() = default;
|
||||
EnvironmentEntry(const EnvironmentEntry &) = default;
|
||||
EnvironmentEntry(EnvironmentEntry &&) = default;
|
||||
|
Loading…
x
Reference in New Issue
Block a user