From f9d0bb8481bed4cea5994ed8aae49fcf52c0e604 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 23 Nov 2009 14:59:18 -0700 Subject: 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. --- cfg.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cfg.mk') diff --git a/cfg.mk b/cfg.mk index babd99b3c..c57c0d3e9 100644 --- a/cfg.mk +++ b/cfg.mk @@ -239,4 +239,10 @@ sc_require_stdio_safer: else :; \ fi +# Prefer xnanosleep over other less-precise sleep methods +sc_prohibit_sleep: + @re='\<(nano|u)?sleep \(' \ + msg='prefer xnanosleep over other sleep interfaces' \ + $(_prohibit_regexp) + include $(srcdir)/dist-check.mk -- cgit v1.2.3-54-g00ecf