summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-01-06 21:15:45 -0500
committerEric S. Raymond <esr@thyrsus.com>2016-01-06 21:15:45 -0500
commitc099ce48e97a94df82b3011a43adb2ec8f107c2a (patch)
treeac98b08fdc0261324e88316a2f2d32ce1b7a8e9c
parentd36294d105a05388593d17040d64247dc5537059 (diff)
downloadgpsd-c099ce48e97a94df82b3011a43adb2ec8f107c2a.tar.gz
Revert attempt to configure clock_gettime(2) on _POSIX_TIMERS...
...seems it broke the Mac port.
-rw-r--r--SConstruct8
-rw-r--r--clock_gettime.c5
2 files changed, 5 insertions, 8 deletions
diff --git a/SConstruct b/SConstruct
index 3a705923..3661c7f2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -665,10 +665,9 @@ else:
announce("You do not have the endian.h header file. RTCM V2 support disabled.")
env["rtcm104v2"] = False
- # check function after libraries, because some functions require libraries
+ # check function after libraries, because some function require libraries
# for example clock_gettime() require librt on Linux glibc < 2.17
- # Note: we now condition use of that function on _POSIX_TIMERS.
- for f in ("daemon", "strlcpy", "strlcat"):
+ for f in ("daemon", "strlcpy", "strlcat", "clock_gettime"):
if config.CheckFunc(f):
confdefs.append("#define HAVE_%s 1\n" % f.upper())
else:
@@ -737,8 +736,7 @@ size_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
}
# endif
#endif
-#include <unistd.h>
-#ifndef _POSIX_TIMERS
+#ifndef HAVE_CLOCK_GETTIME
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/clock_gettime.c b/clock_gettime.c
index 0c04bf7d..9335dd4e 100644
--- a/clock_gettime.c
+++ b/clock_gettime.c
@@ -6,7 +6,6 @@
*/
#include <time.h>
#include <sys/time.h>
-#include <unistd.h> /* for _POSIX_TIMERS */
#include "compiler.h"
@@ -15,7 +14,7 @@
#include <mach/mach.h>
#endif
-#ifndef _POSIX_TIMERS
+#ifndef HAVE_CLOCK_GETTIME
int clock_gettime(clockid_t clk_id UNUSED, struct timespec *ts)
{
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
@@ -43,6 +42,6 @@ int clock_gettime(clockid_t clk_id UNUSED, struct timespec *ts)
#endif /* __MACH__ */
return 0;
}
-#endif /* _POSIX_TIMERS */
+#endif /* HAVE_CLOCK_GETTIME */
/* end */