]> granicus.if.org Git - libevent/commitdiff
Avoid unused-var warning on systems with clock_gettime but without CLOCK_MONOTONIC_COARSE
authorNick Mathewson <nickm@torproject.org>
Thu, 2 Aug 2012 16:35:49 +0000 (12:35 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 2 Aug 2012 16:35:49 +0000 (12:35 -0400)
evutil_time.c

index 7b2043bd5be73c34a1e458cf4e28bc4549b6df46..f677dafc11599e653f35748b17c0fac43342ad83 100644 (file)
@@ -177,7 +177,9 @@ evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
        /* CLOCK_MONOTONIC exists on FreeBSD, Linux, and Solaris.  You need to
         * check for it at runtime, because some older kernel versions won't
         * have it working. */
+#ifdef CLOCK_MONOTONIC_COARSE
        const int precise = flags & EV_MONOT_PRECISE;
+#endif
        const int fallback = flags & EV_MONOT_FALLBACK;
        struct timespec ts;