summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-10-10 02:19:37 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-10-10 02:21:35 +0200
commit2fa2187e68d24648bf77780aaf72c5708681632d (patch)
tree389155c060a85d9be87f53288ae772957de390f5 /src/fastd.h
parentf2087f2da2752b84e000b42575bcc3abafbf57b4 (diff)
downloadfastd-2fa2187e68d24648bf77780aaf72c5708681632d.tar
fastd-2fa2187e68d24648bf77780aaf72c5708681632d.zip
time, compat: don't redefine clock_gettime on MacOS
MacOS X 10.12 has intruduced a clock_gettime function. Use an own function name instead.
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 1206cd8..88adbf9 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -379,6 +379,7 @@ void fastd_iface_write(fastd_iface_t *iface, fastd_buffer_t buffer);
void fastd_iface_close(fastd_iface_t *iface);
void fastd_random_bytes(void *buffer, size_t len, bool secure);
+int64_t fastd_get_time(void);
#ifdef __ANDROID__
@@ -558,10 +559,7 @@ static inline void fastd_timeout_advance(fastd_timeout_t *a, fastd_timeout_t v)
/** Updates the current time */
static inline void fastd_update_time(void) {
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
-
- ctx.now = (1000*(int64_t)ts.tv_sec) + ts.tv_nsec/1000000;
+ ctx.now = fastd_get_time();
}
/** Checks if a on-verify command is set */