diff options
author | Alan Conway <aconway@apache.org> | 2008-07-07 18:48:29 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-07-07 18:48:29 +0000 |
commit | f5afadd09e021bf4ca336e8eeb4a66438bf60c2e (patch) | |
tree | aa7b556deece68ac750790be1282248b2095372e /cpp/src | |
parent | 9d3d5d38eedfb0d098d415fa8c7ae9f1270ac8bb (diff) | |
download | qpid-python-f5afadd09e021bf4ca336e8eeb4a66438bf60c2e.tar.gz |
ForkedBroker: child process exits on completion.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@674587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/tests/ForkedBroker.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/tests/ForkedBroker.h b/cpp/src/tests/ForkedBroker.h index 843c9ab8e2..c2f3346296 100644 --- a/cpp/src/tests/ForkedBroker.h +++ b/cpp/src/tests/ForkedBroker.h @@ -54,6 +54,8 @@ class ForkedBroker : public qpid::sys::ForkWithMessage { std::string prefix; public: + struct ChildExit {}; // Thrown in child processes. + ForkedBroker(const qpid::broker::Broker::Options& opts_, const std::string& prefix_=std::string()) : childPid(0), port(0), opts(opts_), prefix(prefix_) { fork(); } @@ -62,7 +64,7 @@ class ForkedBroker : public qpid::sys::ForkWithMessage { void stop() { if (childPid > 0) { ::kill(childPid, SIGINT); - //FIXME aconway 2008-07-04: ::waitpid(childPid, 0, 0); + ::waitpid(childPid, 0, 0); } } @@ -83,6 +85,10 @@ class ForkedBroker : public qpid::sys::ForkWithMessage { ready(boost::lexical_cast<std::string>(broker->getPort())); // Notify parent. broker->run(); QPID_LOG(notice, "ForkedBroker exiting."); + + // Force exit in the child process, otherwise we will try to + // carry with parent tests. + exit(0); } uint16_t getPort() { return port; } |