]> granicus.if.org Git - libevent/commitdiff
r19564@catbus: nickm | 2008-05-04 13:23:10 -0400
authorNick Mathewson <nickm@torproject.org>
Sun, 4 May 2008 17:23:20 +0000 (17:23 +0000)
committerNick Mathewson <nickm@torproject.org>
Sun, 4 May 2008 17:23:20 +0000 (17:23 +0000)
 Fix compile with --enable-gcc-warnings and clock_gettime()

svn:r766

event.c

diff --git a/event.c b/event.c
index 0078da6d6a49079a7c693a643db6a6483809415c..6386a942a64688fbf7561f0f25dff074976949ec 100644 (file)
--- a/event.c
+++ b/event.c
@@ -159,9 +159,9 @@ gettime(struct event_base *base, struct timeval *tp)
        }
 
 #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
-       struct timespec ts;
-
        if (use_monotonic) {
+               struct timespec ts;
+
                if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
                        return (-1);