mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-01 14:03:30 +08:00
(gettime) [!defined OK_TO_USE_1S_CLOCK]:
Report an error at compile-time if only a 1-second nominal clock resolution is found.
This commit is contained in:
parent
1b7e4389dc
commit
c63680e87b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user