diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-23 18:34:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-23 18:34:19 +0000 |
commit | 9c2700afc5c81f9a9199f6989633d94167f6e68a (patch) | |
tree | f57b19d3ebecf3de738cf5307a739caaa341f97a /src/microspdy | |
parent | 9d0f953af2400c13f8a15f68e625d3d60351dd95 (diff) | |
download | libmicrohttpd-9c2700afc5c81f9a9199f6989633d94167f6e68a.tar.gz libmicrohttpd-9c2700afc5c81f9a9199f6989633d94167f6e68a.zip |
check CLOCK_MONOTONIC is defined
Diffstat (limited to 'src/microspdy')
-rw-r--r-- | src/microspdy/EXPORT.sym | 1 | ||||
-rw-r--r-- | src/microspdy/internal.c | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/microspdy/EXPORT.sym b/src/microspdy/EXPORT.sym index eb6604bc..e0bb71ad 100644 --- a/src/microspdy/EXPORT.sym +++ b/src/microspdy/EXPORT.sym | |||
@@ -1,2 +1,3 @@ | |||
1 | SPDY_start_daemon | 1 | SPDY_start_daemon |
2 | SPDY_stop_daemon | 2 | SPDY_stop_daemon |
3 | SPDYF_monotonic_time | ||
diff --git a/src/microspdy/internal.c b/src/microspdy/internal.c index 0ba83768..647be05b 100644 --- a/src/microspdy/internal.c +++ b/src/microspdy/internal.c | |||
@@ -27,12 +27,14 @@ | |||
27 | 27 | ||
28 | 28 | ||
29 | unsigned long long | 29 | unsigned long long |
30 | SPDYF_monotonic_time(void) | 30 | SPDYF_monotonic_time (void) |
31 | { | 31 | { |
32 | #ifdef HAVE_CLOCK_GETTIME | 32 | #ifdef HAVE_CLOCK_GETTIME |
33 | #ifdef CLOCK_MONOTONIC | ||
33 | struct timespec ts; | 34 | struct timespec ts; |
34 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) | 35 | if (0 == clock_gettime (CLOCK_MONOTONIC, &ts)) |
35 | return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; | 36 | return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; |
36 | #endif | 37 | #endif |
37 | return time(NULL) * 1000; | 38 | #endif |
39 | return time (NULL) * 1000; | ||
38 | } | 40 | } |