summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-07-07 18:48:29 +0000
committerAlan Conway <aconway@apache.org>2008-07-07 18:48:29 +0000
commit0ed50d22182873d604a6208c753a464605d514b8 (patch)
treeeccbaa7e86694a7151ff09eac551f6cdab2b5e97 /qpid/cpp/src/tests
parent9018a2fd309658a4b2fa10078a9efb463060da1b (diff)
downloadqpid-python-0ed50d22182873d604a6208c753a464605d514b8.tar.gz
ForkedBroker: child process exits on completion.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@674587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rw-r--r--qpid/cpp/src/tests/ForkedBroker.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/qpid/cpp/src/tests/ForkedBroker.h b/qpid/cpp/src/tests/ForkedBroker.h
index 843c9ab8e2..c2f3346296 100644
--- a/qpid/cpp/src/tests/ForkedBroker.h
+++ b/qpid/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; }