]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(gettime) [!defined OK_TO_USE_1S_CLOCK]:
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2005 06:30:35 +0000 (06:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2005 06:30:35 +0000 (06:30 +0000)
Report an error at compile-time if only a 1-second nominal clock
resolution is found.

lib/gettime.c

index 0f94297da880cf3ac736bf539e0ab28a5b972cc8..d60711b533516fe3729225310e063dc0b2ec65e1 100644 (file)
@@ -45,8 +45,14 @@ gettime (struct timespec *ts)
     ts->tv_nsec = tv.tv_usec * 1000;
   }
 # else
+
+#  ifndef OK_TO_USE_1S_CLOCK
+#   error "Only 1-second nominal clock resolution found.  Is that intended?" \
+          "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
+#  endif
   ts->tv_sec = time (NULL);
   ts->tv_nsec = 0;
+
 # endif
 
 #endif