summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-11-23 14:59:18 -0700
committerEric Blake <ebb9@byu.net>2009-11-24 06:36:07 -0700
commitf9d0bb8481bed4cea5994ed8aae49fcf52c0e604 (patch)
tree89b6696d0c7a8c7673b14de0fff4214b87633a78 /src/tail.c
parentab6b27eba720c04da91f5300121a6fe06d1fa9b4 (diff)
downloadcoreutils-f9d0bb8481bed4cea5994ed8aae49fcf52c0e604.tar.xz
build: fix link failure on cygwin
Cygwin 1.5 has a broken sleep, and the gnulib tests dragged in rpl_sleep which then caused a link failure because it wasn't in libcoreutils.a. We could solve it by using the gnulib sleep module. However, sleep and usleep may interact poorly with SIGALRM, and they have less granularity; so it is better to adopt a policy that if we must sleep, prefer xnanosleep. * src/sort.c (pipe_fork): Use xnanosleep, to avoid the need for rpl_sleep on cygwin, and to reduce granularity. (MAX_FORK_TRIES_COMPRESS, MAX_FORK_TRIES_DECOMPRESS): Increase, to account for reduction in granularity. * src/tail.c (tail_file): Use xnanosleep in debug code. * cfg.mk (sc_prohibit_sleep): New rule.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index 9a2f5ae82..2bd9e3d65 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1619,7 +1619,7 @@ tail_file (struct File_spec *f, uintmax_t n_units)
/* Before the tail function provided `read_pos', there was
a race condition described in the URL below. This sleep
call made the window big enough to exercise the problem. */
- sleep (1);
+ xnanosleep (1);
#endif
f->errnum = ok - 1;
if (fstat (fd, &stats) < 0)