diff options
| author | Manuel Teira Paz <mteira@apache.org> | 2009-03-10 08:19:28 +0000 |
|---|---|---|
| committer | Manuel Teira Paz <mteira@apache.org> | 2009-03-10 08:19:28 +0000 |
| commit | c2aa2f3a3c4141dce6232679227861b083a18c1f (patch) | |
| tree | 494eeb91864babf0ac7592012410e556f1762410 /cpp/src/tests/failover_soak.cpp | |
| parent | 9b60ec677047daf836c2679294bc1f87c9c76141 (diff) | |
| download | qpid-python-c2aa2f3a3c4141dce6232679227861b083a18c1f.tar.gz | |
configure.ac:
- Add a SOCKLIBS definition, to define needed network libraries in Solaris
src/tests/failover_soak.cpp
- Replace usage of timersub with direct code, since timersub appears to be non-posix.
src/tests/Makefile.am
- Link against $(SOCKLIBS) when needed
src/tests/*
- Some qualifying needed for the Sun compiler
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@752019 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/failover_soak.cpp')
| -rw-r--r-- | cpp/src/tests/failover_soak.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/tests/failover_soak.cpp b/cpp/src/tests/failover_soak.cpp index d84b6d58f7..4f16e469b8 100644 --- a/cpp/src/tests/failover_soak.cpp +++ b/cpp/src/tests/failover_soak.cpp @@ -26,6 +26,8 @@ #include <sys/wait.h> #include <sys/time.h> #include <string.h> +#include <sys/types.h> +#include <signal.h> #include <string> #include <iostream> @@ -237,7 +239,14 @@ struct children : public vector<child *> vector<child *>::iterator i; for ( i = begin(); i != end(); ++ i ) { - timersub ( & now, &((*i)->startTime), & duration ); + //Not in POSIX + //timersub ( & now, &((*i)->startTime), & duration ); + duration.tv_sec = now.tv_sec - (*i)->startTime.tv_sec; + duration.tv_usec = now.tv_usec - (*i)->startTime.tv_usec; + if (duration.tv_usec < 0) { + --duration.tv_sec; + duration.tv_usec += 1000000; + } if ( (COMPLETED != (*i)->status) // child isn't done running && |
