summaryrefslogtreecommitdiff
path: root/ace/Process.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-11-06 19:43:35 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-11-06 19:43:35 +0000
commitb7a548d5159e6bc0260eedec7dbee54ad5013a3f (patch)
treee38307a487a9765d1f3dd82ae1e45989c4e737d4 /ace/Process.cpp
parent9a64532749afa13b87bccdde72d4937408bfa62c (diff)
downloadATCD-b7a548d5159e6bc0260eedec7dbee54ad5013a3f.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Process.cpp')
-rw-r--r--ace/Process.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/ace/Process.cpp b/ace/Process.cpp
index d096946243f..beebb41aac6 100644
--- a/ace/Process.cpp
+++ b/ace/Process.cpp
@@ -74,10 +74,26 @@ ACE_Process::spawn (ACE_Process_Options &options)
this->child_id_ = ACE_OS::execvp (options.command_line_argv ()[0],
options.command_line_argv ());
else
- // Command-line args and environment variables
- this->child_id_ = ACE_OS::execve (options.command_line_argv ()[0],
- options.command_line_argv (),
- options.env_argv ());
+ {
+ // Added the new environment variables.
+ for (char **user_env = options.env_argv ();
+ *user_env != 0;
+ user_env++)
+ ACE_OS::putenv (*user_env);
+
+ // Now the forked process has both inherited variables and the
+ // user's supplied variables.
+ this->child_id_ = ACE_OS::execvp (options.command_line_argv ()[0],
+ options.command_line_argv ());
+ }
+
+#if 0
+ // command-line args and environment variables
+ result = ACE_OS::execve (options.command_line_argv ()[0],
+ options.command_line_argv (),
+ options.env_argv ());
+#endif
+
return this->child_id_;
#else /* ACE_WIN32 */
// Fork the new process.
@@ -129,10 +145,17 @@ ACE_Process::spawn (ACE_Process_Options &options)
// anyways.
ACE_NOTSUP_RETURN (-1);
#else
- // command-line args and environment variables
- result = ACE_OS::execve (options.command_line_argv ()[0],
- options.command_line_argv (),
- options.env_argv ());
+ // Added the new environment variables.
+ for (char **user_env = options.env_argv ();
+ *user_env != 0;
+ user_env++)
+ ACE_OS::putenv (*user_env);
+
+ // Now the forked process has both inherited variables and the
+ // user's supplied variables.
+ this->child_id_ = ACE_OS::execvp (options.command_line_argv ()[0],
+ options.command_line_argv ());
+ }
#endif /* ghs */
}