diff options
author | Daniel Mierswa <impulze@impulze.org> | 2009-08-30 23:58:57 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-08-30 23:58:57 +0200 |
commit | 959e8b5decb32fda0a8c8be21aff8bc17382586d (patch) | |
tree | 25b419d0fab9c616e52a3552f8bc8e3644ab637b /udev/udevadm-settle.c | |
parent | c45e22151313878dcce33c788f9eebbd93842008 (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.c | 4 |
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 */ |