[Box Backup-commit] COMMIT r1567 - box/chris/merge/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Apr 22 16:49:22 BST 2007


Author: chris
Date: 2007-04-22 16:49:22 +0100 (Sun, 22 Apr 2007)
New Revision: 1567

Modified:
   box/chris/merge/lib/common/Test.h
Log:
Merge [1566] from chris/general:

Use Sleep() instead of nanosleep again on win32 (lost in merge [1562]).

Fix reference to pCommandLine which no longer exists after [1562].

Fix signed/unsigned comparison warning. (refs #3)


Modified: box/chris/merge/lib/common/Test.h
===================================================================
--- box/chris/merge/lib/common/Test.h	2007-04-22 15:48:00 UTC (rev 1566)
+++ box/chris/merge/lib/common/Test.h	2007-04-22 15:49:22 UTC (rev 1567)
@@ -99,7 +99,7 @@
 	// convert UNIX paths to native
 
 	std::string converted;
-	for (int i = 0; i < rOriginal.size(); i++)
+	for (size_t i = 0; i < rOriginal.size(); i++)
 	{
 		if (rOriginal[i] == '/')
 		{
@@ -206,7 +206,8 @@
 	if (result == 0)
 	{
 		DWORD err = GetLastError();
-		printf("Launch failed: %s: error %d\n", pCommandLine, (int)err);
+		printf("Launch failed: %s: error %d\n", rCommandLine.c_str(),
+			(int)err);
 		return -1;
 	}
 
@@ -402,11 +403,15 @@
 
 inline void safe_sleep(int seconds)
 {
+#ifdef WIN32
+	Sleep(seconds * 1000);
+#else
 	struct timespec ts;
 	ts.tv_sec  = seconds;
 	ts.tv_nsec = 0;
 	while (nanosleep(&ts, &ts) == -1 && errno == EINTR)
 	{ /* sleep again */ }
+#endif
 }
 
 #endif // TEST__H




More information about the Boxbackup-commit mailing list