]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: time: remove the test on _POSIX_C_SOURCE
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 17:12:54 +0000 (19:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 17:14:59 +0000 (19:14 +0200)
It seems it's not defined on FreeBSD while it's mentioned on Linux that
clock_gettime() can be detected using this. Given that we also have the
test for _POSIX_TIMERS>0 that should cover it well enough. If it breaks
on other systems, we'll see.

Report was here :
    https://github.com/haproxy/haproxy/runs/133866993

include/common/compat.h
src/wdt.c

index 9b97d821440dcdb5ed18680c9b5a07a84703656c..088b2c9b217d6f5fb1677b3b41a5883ad77a5bf6 100644 (file)
@@ -105,7 +105,7 @@ typedef struct { } empty_t;
 #endif
 
 /* systems without such defines do not know clockid_t or timer_t */
-#if !(_POSIX_TIMERS > 0) || (_POSIX_C_SOURCE < 199309L)
+#if !(_POSIX_TIMERS > 0)
 #undef clockid_t
 #define clockid_t empty_t
 #undef timer_t
index 10b7e5e24b002e5bfe56723852744c58587ca9a8..45438d6b5b04a5dc436ca12bb66e13dcfaac3f0c 100644 (file)
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -25,7 +25,7 @@
  * It relies on timer_create() and timer_settime() which are only available in
  * this case.
  */
-#if defined(USE_THREAD) && (_POSIX_TIMERS > 0) && defined(_POSIX_THREAD_CPUTIME) && (_POSIX_C_SOURCE >= 199309L)
+#if defined(USE_THREAD) && (_POSIX_TIMERS > 0) && defined(_POSIX_THREAD_CPUTIME)
 
 /* We'll deliver SIGALRM when we've run out of CPU as it's not intercepted by
  * gdb by default.