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

Christophe Fergeau cfergeau at redhat.com
Wed Mar 13 03:15:45 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 16f7033..04257e9 100644
--- a/SpiceXPI/src/plugin/controller-unix.cpp
+++ b/SpiceXPI/src/plugin/controller-unix.cpp
@@ -131,7 +131,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