From: Paul Eggert Date: Sat, 26 Nov 2005 06:30:35 +0000 (+0000) Subject: (gettime) [!defined OK_TO_USE_1S_CLOCK]: X-Git-Tag: v6.0~1253 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c63680e87b2052cb573bff107b87f43bf679c011;p=thirdparty%2Fcoreutils.git (gettime) [!defined OK_TO_USE_1S_CLOCK]: Report an error at compile-time if only a 1-second nominal clock resolution is found. --- diff --git a/lib/gettime.c b/lib/gettime.c index 0f94297da8..d60711b533 100644 --- a/lib/gettime.c +++ b/lib/gettime.c @@ -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