[Box Backup-commit] COMMIT r1105 - box/trunk/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Fri Oct 27 19:59:44 BST 2006


Author: chris
Date: 2006-10-27 19:59:44 +0100 (Fri, 27 Oct 2006)
New Revision: 1105

Modified:
   box/trunk/lib/common/Test.h
Log:
Added a RunCommand() function which converts UNIX paths to native before
calling ::system() on Win32.


Modified: box/trunk/lib/common/Test.h
===================================================================
--- box/trunk/lib/common/Test.h	2006-10-27 18:58:33 UTC (rev 1104)
+++ box/trunk/lib/common/Test.h	2006-10-27 18:59:44 UTC (rev 1105)
@@ -79,7 +79,7 @@
 	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 @@
 	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");




More information about the Boxbackup-commit mailing list