summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-10-27 18:59:44 +0000
committerChris Wilson <chris+github@qwirx.com>2006-10-27 18:59:44 +0000
commitd58187704b664c5b2879321855a285a5c6160cfe (patch)
tree44a0513d96bffccadddf1f8ccf7c95d5a8c63db3 /lib/common
parent192d2a1fb9a17abf4ebe103f61b57c0f1f57bc0b (diff)
Added a RunCommand() function which converts UNIX paths to native before
calling ::system() on Win32.
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/Test.h9
1 files changed, 7 insertions, 2 deletions
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");