diff options
author | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-10-28 21:12:30 +0000 |
---|---|---|
committer | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-10-28 21:12:30 +0000 |
commit | 151da3b15a9641862452a737deee140617d6589c (patch) | |
tree | 6d9fbd227e4a5e4874b8fc1989d7c03f73af047e /ACE/ace/Process.cpp | |
parent | 5830508fd91ff7489716d7ff9308568e65d11fe6 (diff) | |
download | ATCD-151da3b15a9641862452a737deee140617d6589c.tar.gz |
ChangeLogTag: Sun Oct 28 21:11:57 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'ACE/ace/Process.cpp')
-rw-r--r-- | ACE/ace/Process.cpp | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index 7bfd14275bd..16f14a83c88 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -353,9 +353,16 @@ ACE_Process::spawn (ACE_Process_Options &options) if (options.getgroup () != ACE_INVALID_PID && ACE_OS::setpgid (0, options.getgroup ()) < 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p.\n"), - ACE_TEXT ("ACE_Process::spawn: setpgid failed."))); + { +#if !defined (ACE_HAS_THREADS) + // We can't emit this log message because ACE_ERROR(), etc. + // will invoke async signal unsafe functions, which results + // in undefined behavior in threaded programs. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p.\n"), + ACE_TEXT ("ACE_Process::spawn: setpgid failed."))); +#endif + } # endif /* ACE_LACKS_SETPGID */ # if !defined (ACE_LACKS_SETREGID) @@ -363,9 +370,16 @@ ACE_Process::spawn (ACE_Process_Options &options) || options.getegid () != (uid_t) -1) if (ACE_OS::setregid (options.getrgid (), options.getegid ()) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p.\n"), - ACE_TEXT ("ACE_Process::spawn: setregid failed."))); + { +#if !defined (ACE_HAS_THREADS) + // We can't emit this log message because ACE_ERROR(), etc. + // will invoke async signal unsafe functions, which results + // in undefined behavior in threaded programs. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p.\n"), + ACE_TEXT ("ACE_Process::spawn: setregid failed."))); +#endif + } # endif /* ACE_LACKS_SETREGID */ # if !defined (ACE_LACKS_SETREUID) @@ -374,9 +388,16 @@ ACE_Process::spawn (ACE_Process_Options &options) || options.geteuid () != (uid_t) -1) if (ACE_OS::setreuid (options.getruid (), options.geteuid ()) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p.\n"), - ACE_TEXT ("ACE_Process::spawn: setreuid failed."))); + { +#if !defined (ACE_HAS_THREADS) + // We can't emit this log message because ACE_ERROR(), etc. + // will invoke async signal unsafe functions, which results + // in undefined behavior in threaded programs. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p.\n"), + ACE_TEXT ("ACE_Process::spawn: setreuid failed."))); +#endif + } # endif /* ACE_LACKS_SETREUID */ this->child (ACE_OS::getppid ()); |