about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--ext/clogger_ext/broken_system_compat.h2
-rw-r--r--ext/clogger_ext/clogger.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/ext/clogger_ext/broken_system_compat.h b/ext/clogger_ext/broken_system_compat.h
index ec635b1..632612b 100644
--- a/ext/clogger_ext/broken_system_compat.h
+++ b/ext/clogger_ext/broken_system_compat.h
@@ -4,7 +4,7 @@
  */
 
 #ifndef HAVE_TYPE_CLOCKID_T
-typedef clockid_t int;
+typedef int clockid_t;
 #endif
 
 #ifndef HAVE_CLOCK_GETTIME
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index 604b9b6..d96b046 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -25,12 +25,14 @@
  * since we could've been built on a different system than we're run
  * under.
  */
-static clockid_t hopefully_CLOCK_MONOTONIC = CLOCK_MONOTONIC;
+static clockid_t hopefully_CLOCK_MONOTONIC;
 
 static void check_clock(void)
 {
         struct timespec now;
 
+        hopefully_CLOCK_MONOTONIC = CLOCK_MONOTONIC;
+
         /* we can't check this reliably at compile time */
         if (clock_gettime(CLOCK_MONOTONIC, &now) == 0)
                 return;