Source: nut
Version: 2.6.1-1
Severity: normal
Tags: patch

  usleep is stated in its manual page as removed by POSIX.

    $ grep -Ir usleep nut-2.6.1 | wc -l
    65
    $

drivers/tripplite_usb.c also mentions this.  Attached an appropriate
diff for 2/65 instanaces.  Just to see if I am not fundamentally
wrong.

--- nut-2.6.1/clients/upssched.c  2011-05-31 13:36:47.000000000 +0300
+++ nut-2.6.1/clients/upssched.c  2011-07-13 03:02:33.000000000 +0300
@@ -652,7 +652,7 @@
                unlink(lockfn);

                /* give the other one a chance to start it, then try again */
-               usleep(250000);
+               struct timespec sleep = {0, 250000000}; nanosleep(&sleep, NULL);
        }

        upslog_with_errno(LOG_ERR, "Failed to connect to parent and failed to 
create parent");
@@ -705,7 +705,7 @@
                if (pipefd == PARENT_STARTED) {

                        /* loop back and try to connect now */
-                       usleep(250000);
+                       struct timespec sleep = {0, 250000000}; 
nanosleep(&sleep, NULL);
                        continue;
                }




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to