From d58187704b664c5b2879321855a285a5c6160cfe Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 27 Oct 2006 18:59:44 +0000 Subject: Added a RunCommand() function which converts UNIX paths to native before calling ::system() on Win32. --- lib/common/Test.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/common') diff --git a/lib/common/Test.h b/lib/common/Test.h index 75ed93aa..5e42e406 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -79,7 +79,7 @@ inline int TestGetFileSize(const char *Filename) return -1; } -inline int LaunchServer(const char *pCommandLine, const char *pidFile) +inline int RunCommand(const char *pCommandLine) { #ifdef WIN32 // convert UNIX paths to native @@ -101,7 +101,12 @@ inline int LaunchServer(const char *pCommandLine, const char *pidFile) std::string command = pCommandLine; #endif - if(::system(command.c_str()) != 0) + return ::system(command.c_str()); +} + +inline int LaunchServer(const char *pCommandLine, const char *pidFile) +{ + if(RunCommand(pCommandLine) != 0) { printf("Server: %s\n", command.c_str()); TEST_FAIL_WITH_MESSAGE("Couldn't start server"); -- cgit v1.2.3