diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2008-10-23 14:52:26 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2008-10-23 14:52:26 +0000 |
commit | 06205d2702bde8d70cfbf56a2c48e4f6c6c0de8d (patch) | |
tree | 30944540564ad9ae944ce266916a7c3e50a7fa86 /ACE/ace/Process.cpp | |
parent | 57aa469665bd87a3cc876d244552c9baf09522ab (diff) | |
download | ATCD-06205d2702bde8d70cfbf56a2c48e4f6c6c0de8d.tar.gz |
ChangeLogTag:Thu
Diffstat (limited to 'ACE/ace/Process.cpp')
-rw-r--r-- | ACE/ace/Process.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index ef5d8878158..e46b7bf10ff 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -359,14 +359,6 @@ ACE_Process::spawn (ACE_Process_Options &options) return this->child_id_; #else /* ACE_WIN32 */ - if (!options.handle_inheritance()) { - // Set close-on-exec for all FDs except standard handles - for (int i = ACE::max_handles () - 1; i >= 0; i--) { - if ((i == ACE_STDIN) || (i == ACE_STDOUT) || (i == ACE_STDERR)) - continue; - ACE_OS::fcntl (i, F_SETFD, FD_CLOEXEC); - } - } // Fork the new process. this->child_id_ = ACE::fork (options.process_name (), options.avoid_zombies ()); @@ -463,6 +455,14 @@ ACE_Process::spawn (ACE_Process_Options &options) ACE_OS::close (options.get_stdin ()); ACE_OS::close (options.get_stdout ()); ACE_OS::close (options.get_stderr ()); + if (!options.handle_inheritence()) { + // Set close-on-exec for all FDs except standard handles + for (int i = ACE::max_handles () - 1; i >= 0; i--) { + if ((i == ACE_STDIN) || (i == ACE_STDOUT) || (i == ACE_STDERR)) + continue; + ACE_OS::fcntl (i, F_SETFD, FD_CLOEXEC); + } + } // If we must, set the working directory for the child // process. |