diff options
author | Bernard Normier <bernard@zeroc.com> | 2003-12-04 21:27:14 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2003-12-04 21:27:14 +0000 |
commit | 702408810f0fcfe033f6036523d0fa7c41dadbbc (patch) | |
tree | 8fd054b77e578039731df884f5498747d1aade36 /cpp/src/IcePack/ActivatorI.cpp | |
parent | Switch from exit to _exit when execvp fails, and cleanup between fork and (diff) | |
download | ice-702408810f0fcfe033f6036523d0fa7c41dadbbc.tar.bz2 ice-702408810f0fcfe033f6036523d0fa7c41dadbbc.tar.xz ice-702408810f0fcfe033f6036523d0fa7c41dadbbc.zip |
Replaced exit by _exit before fork an exec
Diffstat (limited to 'cpp/src/IcePack/ActivatorI.cpp')
-rw-r--r-- | cpp/src/IcePack/ActivatorI.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cpp/src/IcePack/ActivatorI.cpp b/cpp/src/IcePack/ActivatorI.cpp index 531521fa138..4c71faf34b1 100644 --- a/cpp/src/IcePack/ActivatorI.cpp +++ b/cpp/src/IcePack/ActivatorI.cpp @@ -214,6 +214,12 @@ IcePack::ActivatorI::activate(const ServerPtr& server) if(pid == 0) // Child process. { + // + // TODO: eliminate all non-async-signal-safe calls, in particular anything + // that may allocated dynamic memory + // + + #ifdef __linux // // Create a process group for this child, to be able to send @@ -260,7 +266,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server) s << "can't set environment variable: " << *q << "':\n" << ex; write(fds[1], s.str().c_str(), s.str().length()); close(fds[1]); - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); } } @@ -292,7 +298,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server) // s << "can't redirect stderr to the pipe output"; // write(fds[1], s.str().c_str(), s.str().length()); // close(fds[1]); -// exit(EXIT_FAILURE); +// _exit(EXIT_FAILURE); // } // } @@ -313,7 +319,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server) s << "can't change working directory to `" << pwd << "':\n" << ex; write(fds[1], s.str().c_str(), s.str().length()); close(fds[1]); - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); } } @@ -329,7 +335,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server) s << "can't execute `" << path << "':\n" << ex; write(fds[1], s.str().c_str(), s.str().length()); close(fds[1]); - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); } } else // Parent process. |