summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-04-22 15:49:22 +0000
committerChris Wilson <chris+github@qwirx.com>2007-04-22 15:49:22 +0000
commitfbfc77472d66ce1c3e2bb14f7031e2d8ed75d422 (patch)
treeb7dd28eec0bdfb49afc554caf098737dabed8793 /lib
parentf8d41c2eec776ce3c9920fd01fd3971dc99cf531 (diff)
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)
Diffstat (limited to 'lib')
-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 89f74563..716ff563 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -99,7 +99,7 @@ inline std::string ConvertPaths(const std::string& rOriginal)
// 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 @@ inline int LaunchServer(const std::string& rCommandLine, const char *pidFile)
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 wait_for_operation(int seconds)
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