]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Change some usleep() to nanosleep() `cause usleep() is obsolete since
[stg.git] / projects / stargazer / main.cpp
index 63d5a6b09454f422c4d91253c2ca469b03670276..2c789ff64877e3ac19cf376a5842df8f7ec63637 100644 (file)
@@ -386,6 +386,7 @@ switch (stgChildPid)
         break;
 
     default:
+        struct timespec ts = {0, 200000000};
         for (int i = 0; i < 120 * 5; i++)
             {
             if (access(startFile.c_str(), F_OK) == 0)
@@ -399,7 +400,7 @@ switch (stgChildPid)
                 unlink(startFile.c_str());
                 exit(1);
                 }
-            usleep(200000);
+            nanosleep(&ts, NULL);
             }
         unlink(startFile.c_str());
         exit(1);