diff options
Diffstat (limited to 'src/microhttpd/internal.c')
-rw-r--r-- | src/microhttpd/internal.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c index 52d0979f..ef286b20 100644 --- a/src/microhttpd/internal.c +++ b/src/microhttpd/internal.c | |||
@@ -158,14 +158,19 @@ MHD_http_unescape (void *cls, | |||
158 | return wpos - val; /* = strlen(val) */ | 158 | return wpos - val; /* = strlen(val) */ |
159 | } | 159 | } |
160 | 160 | ||
161 | time_t MHD_monotonic_time(void) | 161 | |
162 | time_t | ||
163 | MHD_monotonic_time (void) | ||
162 | { | 164 | { |
163 | #ifdef HAVE_CLOCK_GETTIME | 165 | #ifdef HAVE_CLOCK_GETTIME |
164 | struct timespec ts; | 166 | #ifdef CLOCK_MONOTONIC |
165 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) | 167 | struct timespec ts; |
166 | return ts.tv_sec; | 168 | |
169 | if (0 == clock_gettime (CLOCK_MONOTONIC, &ts)) | ||
170 | return ts.tv_sec; | ||
171 | #endif | ||
167 | #endif | 172 | #endif |
168 | return time(NULL); | 173 | return time (NULL); |
169 | } | 174 | } |
170 | 175 | ||
171 | /* end of internal.c */ | 176 | /* end of internal.c */ |