[Spice-devel] [spice-xpi 11/12] Use g_usleep in SpiceController::connect(int retries)

Christophe Fergeau cfergeau at redhat.com
Tue Mar 12 04:23:06 PDT 2013


g_usleep is more portable than sleep()
---
 SpiceXPI/src/plugin/controller-unix.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SpiceXPI/src/plugin/controller-unix.cpp b/SpiceXPI/src/plugin/controller-unix.cpp
index 743e00b..ddbd8c0 100644
--- a/SpiceXPI/src/plugin/controller-unix.cpp
+++ b/SpiceXPI/src/plugin/controller-unix.cpp
@@ -132,7 +132,7 @@ int SpiceController::Connect(const int nRetries)
     for (int i = 0; rc != 0 && i < nRetries; ++i)
     {
         rc = Connect();
-        sleep(sleep_time);
+        g_usleep(sleep_time * G_USEC_PER_SEC);
         ++sleep_time;
     }
 
-- 
1.8.1.4



More information about the Spice-devel mailing list