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 | 72f7b9fd587d4742a1835d6d783d5914ec1556ab (patch) | |
tree | 30944540564ad9ae944ce266916a7c3e50a7fa86 | |
parent | 22ef003dc59be8f4673fd2779f6921842900f3d9 (diff) | |
download | ATCD-72f7b9fd587d4742a1835d6d783d5914ec1556ab.tar.gz |
ChangeLogTag:Thu
-rw-r--r-- | ACE/ChangeLog | 6 | ||||
-rw-r--r-- | ACE/ace/Process.cpp | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index a33dcbd426f..ff7083a7fab 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,9 @@ +Thu Oct 23 12:52:21 UTC 2008 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> + + * ace/Process.cpp: Enhanced the support for enabling/disabling + handle inheritance on Linux. Thanks to Christian Fromme + <christian at ast.dfs dot de> for this fix. + Thu Oct 23 11:14:00 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * ace/Process.cpp: 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. |