diff options
author | Andrew Stitcher <astitcher@apache.org> | 2008-04-23 18:01:49 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2008-04-23 18:01:49 +0000 |
commit | 859afc26bd61dea1e940f56f05a37ca1c40fe4e1 (patch) | |
tree | f8e75f13834af20e8dcf27a03bfa00f608d2b3ee | |
parent | d773d967f2b6131e9ab17456342d004a0d88e6ab (diff) | |
download | qpid-python-859afc26bd61dea1e940f56f05a37ca1c40fe4e1.tar.gz |
Patch from Mick Goulish: Fixes to previous improved portability patch
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@650970 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/Options.cpp | 40 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/Daemon.cpp | 41 | ||||
-rw-r--r-- | qpid/cpp/src/tests/.valgrind.supp | 74 |
3 files changed, 115 insertions, 40 deletions
diff --git a/qpid/cpp/src/qpid/Options.cpp b/qpid/cpp/src/qpid/Options.cpp index 1628fea0df..452844897d 100644 --- a/qpid/cpp/src/qpid/Options.cpp +++ b/qpid/cpp/src/qpid/Options.cpp @@ -57,26 +57,26 @@ struct EnvOptMapper { if (i != opts.options().end()) return (*i)->long_name(); #else - /*=================================================================== - For Boost version 103200 and below. - - In Boost version 103200, the options_description::options member, - used above, is private. So what I will do here is use the - count() funtion, which returns a 1 or 0 indicating presence or - absence of the environment variable. - - If it is present, I will return its name. Env vars do not have - short and long forms, so the name is synonymous with the long - name. (This would not work for command line args.) - And if it's absent -- an empty string. - =====================================================================*/ - - - /*------------------------------------------------------------ - The env vars come in unaltered, i.e. QPID_FOO, but the - options are stored normalized as "qpid-foo". Change the - local variable "env" so it can be found by "opts". - ------------------------------------------------------------*/ + /* + * For Boost version 103200 and below. + * + * In Boost version 103200, the options_description::options member, + * used above, is private. So what I will do here is use the + * count() funtion, which returns a 1 or 0 indicating presence or + * absence of the environment variable. + * + * If it is present, I will return its name. Env vars do not have + * short and long forms, so the name is synonymous with the long + * name. (This would not work for command line args.) + * And if it's absent -- an empty string. + */ + + + /* + * The env vars come in unaltered, i.e. QPID_FOO, but the + * options are stored normalized as "qpid-foo". Change the + * local variable "env" so it can be found by "opts". + */ for (std::string::iterator i = env.begin(); i != env.end(); ++i) { *i = (*i == '_') diff --git a/qpid/cpp/src/qpid/broker/Daemon.cpp b/qpid/cpp/src/qpid/broker/Daemon.cpp index 6fd1c3a292..a42f503708 100644 --- a/qpid/cpp/src/qpid/broker/Daemon.cpp +++ b/qpid/cpp/src/qpid/broker/Daemon.cpp @@ -41,10 +41,10 @@ void throwIf(bool condition, const string& msg, int errNo=errno) { } -/*-------------------------------------------------- - Rewritten using low-level IO, for compatibility - with earlier Boost versions, i.e. 103200. ---------------------------------------------------*/ +/* + * Rewritten using low-level IO, for compatibility + * with earlier Boost versions, i.e. 103200. + */ struct LockFile { LockFile(const std::string& path_, bool create) @@ -86,10 +86,10 @@ string Daemon::pidFile(uint16_t port) { return path.str(); } -/*-------------------------------------------------- - Rewritten using low-level IO, for compatibility - with earlier Boost versions, i.e. 103200. ---------------------------------------------------*/ +/* + * Rewritten using low-level IO, for compatibility + * with earlier Boost versions, i.e. 103200. + */ void Daemon::fork() { throwIf(::pipe(pipeFds) < 0, "Can't create pipe"); @@ -143,10 +143,10 @@ uint16_t Daemon::wait(int timeout) { // parent waits for child. tv.tv_sec = timeout; tv.tv_usec = 0; - /*-------------------------------------------------- - Rewritten using low-level IO, for compatibility - with earlier Boost versions, i.e. 103200. - --------------------------------------------------*/ + /* + * Rewritten using low-level IO, for compatibility + * with earlier Boost versions, i.e. 103200. + */ fd_set fds; FD_ZERO(&fds); FD_SET(pipeFds[0], &fds); @@ -198,10 +198,10 @@ void Daemon::ready(uint16_t port) { // child lockFile = pidFile(port); LockFile lf(lockFile, true); - /*--------------------------------------------------- - Rewritten using low-level IO, for compatibility - with earlier Boost versions, i.e. 103200. - ---------------------------------------------------*/ + /* + * Rewritten using low-level IO, for compatibility + * with earlier Boost versions, i.e. 103200. + */ /* * Write the PID to the lockfile. */ @@ -230,10 +230,11 @@ pid_t Daemon::getPid(uint16_t port) { string name = pidFile(port); LockFile lf(name, false); pid_t pid; - /*--------------------------------------------------- - Rewritten using low-level IO, for compatibility - with earlier Boost versions, i.e. 103200. - ---------------------------------------------------*/ + + /* + * Rewritten using low-level IO, for compatibility + * with earlier Boost versions, i.e. 103200. + */ int desired_read = sizeof(pid_t); if ( desired_read > ::read(lf.fd, & pid, desired_read) ) { throw Exception("Cannot read lock file " + name); diff --git a/qpid/cpp/src/tests/.valgrind.supp b/qpid/cpp/src/tests/.valgrind.supp index e0abf0dd43..1159067c11 100644 --- a/qpid/cpp/src/tests/.valgrind.supp +++ b/qpid/cpp/src/tests/.valgrind.supp @@ -30,3 +30,77 @@ fun:epoll_ctl } +{ + RHEL4 -- we think Boost is responsible for these leaks. + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost15program_options??options_description* +} + +{ + RHEL4 -- we think Boost is responsible for these leaks. + Memcheck:Leak + fun:_Znwm + fun:_ZN5boost9unit_test9test_case* +} + +{ + RHEL4 -- we think Boost is responsible for these leaks. + Memcheck:Leak + fun:calloc + fun:_dlerror_run + fun:dlopen@@GLIBC_2.2.5 + fun:_ZN4qpid3sys5Shlib4loadEPKc + fun:_Z9testShlibv + fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv + obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0 + fun:_ZN5boost17execution_monitor7executeEbi + fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi + fun:_ZN5boost9unit_test9test_case3runEv + fun:_ZN5boost9unit_test10test_suite6do_runEv + fun:_ZN5boost9unit_test9test_case3runEv + fun:main +} + +{ + RHEL4 -- we think Boost is responsible for these leaks. + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.2.5 + fun:_ZN4qpid6broker5Timer5startEv + fun:_ZN4qpid6broker5TimerC1Ev + fun:_ZN4qpid6broker10DtxManagerC1Ev + fun:_ZN4qpid6broker6BrokerC1ERKNS1_7OptionsE + fun:_ZN4qpid6broker6Broker6createERKNS1_7OptionsE + fun:_ZN15SessionFixtureTI15ProxyConnectionEC2Ev + fun:_Z14testQueueQueryv + fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv + obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0 + fun:_ZN5boost17execution_monitor7executeEbi + fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi + fun:_ZN5boost9unit_test9test_case3runEv + fun:_ZN5boost9unit_test10test_suite6do_runEv + fun:_ZN5boost9unit_test9test_case3runEv + fun:main +} + +{ + INVESTIGATE + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.2.5 + fun:_ZN4qpid6client9Connector4initEv + fun:_ZN4qpid6client14ConnectionImpl4openERKSsiS3_S3_S3_ +} + +{ + INVESTIGATE + Memcheck:Param + write(buf) + obj:/lib64/tls/libc-2.3.4.so + fun:_ZNK4qpid3sys6Socket5writeEPKvm + fun:_ZN4qpid3sys8AsynchIO9writeableERNS0_14DispatchHandleE +} + |