summaryrefslogtreecommitdiff
path: root/udev/udevadm-settle.c
diff options
context:
space:
mode:
authorDaniel Mierswa <impulze@impulze.org>2009-08-30 23:58:57 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-08-30 23:58:57 +0200
commit959e8b5decb32fda0a8c8be21aff8bc17382586d (patch)
tree25b419d0fab9c616e52a3552f8bc8e3644ab637b /udev/udevadm-settle.c
parentc45e22151313878dcce33c788f9eebbd93842008 (diff)
use nanosleep() instead of usleep()
POSIX.1-2001 declares usleep() function obsolete and POSIX.1-2008 removes it. [Kay Sievers] - include time.h - use const for timespec - scsi_id: drop rand() in retry loop - modem-probe: rename msuspend() to msleep()
Diffstat (limited to 'udev/udevadm-settle.c')
-rw-r--r--udev/udevadm-settle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c
index 682819201e..124c59698c 100644
--- a/udev/udevadm-settle.c
+++ b/udev/udevadm-settle.c
@@ -28,6 +28,7 @@
#include <syslog.h>
#include <getopt.h>
#include <signal.h>
+#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -180,6 +181,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
while (1) {
struct stat statbuf;
+ const struct timespec duration = { 0 , 1000 * 1000 * 1000 / LOOP_PER_SECOND };
if (exists != NULL && stat(exists, &statbuf) == 0) {
rc = 0;
@@ -203,7 +205,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
if (is_timeout)
break;
- usleep(1000 * 1000 / LOOP_PER_SECOND);
+ nanosleep(&duration, NULL);
}
/* if we reached the timeout, print the list of remaining events */