From: Francesco Chemolli Date: Sat, 22 Sep 2012 18:46:52 +0000 (+0200) Subject: Make IPC base path absolute in testRock X-Git-Tag: SQUID_3_3_0_1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dccf1c6ecad021d7cbad209e742ab6edfb200ee;p=thirdparty%2Fsquid.git Make IPC base path absolute in testRock --- diff --git a/src/tests/testRock.cc b/src/tests/testRock.cc index 088e347c77..e403d3a745 100644 --- a/src/tests/testRock.cc +++ b/src/tests/testRock.cc @@ -21,6 +21,9 @@ #if HAVE_STDEXCEPT #include #endif +#if HAVE_UNISTD_H +#include +#endif #define TESTDIR "testRock__testRockSearch" @@ -28,6 +31,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testRock ); extern REMOVALPOLICYCREATE createRemovalPolicy_lru; +static char cwd[MAXPATHLEN]; + static void addSwapDir(testRock::SwapDirPointer aStore) { @@ -45,7 +50,9 @@ testRock::setUp() throw std::runtime_error("Failed to clean test work directory"); // use current directory for shared segments (on path-based OSes) - Ipc::Mem::Segment::BasePath = "."; + Ipc::Mem::Segment::BasePath = getcwd(cwd,MAXPATHLEN); + if (Ipc::Mem::Segment::BasePath == NULL) + Ipc::Mem::Segment::BasePath = "."; Store::Root(new StoreController);