summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorKarel Zak2014-01-24 13:04:14 +0100
committerKarel Zak2014-01-24 13:04:14 +0100
commita5bd7939961aaa6e39f3b298e556063cfd97d75a (patch)
treec7b5425996072f268f5cbb6c5496a4a2a95a5256 /term-utils/agetty.c
parentflock: Change the 'exit status' man page section to make more sense (diff)
downloadkernel-qcow2-util-linux-a5bd7939961aaa6e39f3b298e556063cfd97d75a.tar.gz
kernel-qcow2-util-linux-a5bd7939961aaa6e39f3b298e556063cfd97d75a.tar.xz
kernel-qcow2-util-linux-a5bd7939961aaa6e39f3b298e556063cfd97d75a.zip
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>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index baa1b38cb..7c0579c63 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1589,7 +1589,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
/* The terminal could be open with O_NONBLOCK when
* -L (force CLOCAL) is specified... */
if (errno == EINTR || errno == EAGAIN) {
- usleep(250000);
+ xusleep(250000);
continue;
}
switch (errno) {