]> git.ipfire.org Git - thirdparty/util-linux.git/commit
include/c.h: prefer nanosleep() over usleep()
authorKarel Zak <kzak@redhat.com>
Fri, 24 Jan 2014 12:04:14 +0000 (13:04 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Jan 2014 12:04:14 +0000 (13:04 +0100)
commita5bd7939961aaa6e39f3b298e556063cfd97d75a
treec7b5425996072f268f5cbb6c5496a4a2a95a5256
parent3523ca7da47b10088a396595580de8b27f3a7082
include/c.h: prefer nanosleep() over usleep()

Let's use nanosleep() although if usleep() exists. The nanosleep
function does no interact with signals and other timers.

The patch introduces xusleep() as replacement to libc (or our fallback)
usleep(). Yes, we don't want to use struct timespec + nanosleep()
everywhere in code as nano-time resolution is useless for us.

The patch also enlarges delays in some busy wait loops. It seems
enough to try read/write 4x per second.

Signed-off-by: Karel Zak <kzak@redhat.com>
include/all-io.h
include/c.h
libmount/src/lock.c
login-utils/sulogin.c
sys-utils/hwclock-kd.c
sys-utils/rtcwake.c
term-utils/agetty.c
text-utils/tailf.c