reference: check for unset leap_when in is_leap_close()
Check that the leap_when variable is set before testing a timestamp for being close to a leap second. This allows the first measurement to be accepted if starting at the Unix epoch (e.g. in a test).
This commit is contained in:
parent
6a79771898
commit
89a5e21e4d
1 changed files with 2 additions and 1 deletions
|
@ -1333,7 +1333,8 @@ REF_DisableLocal(void)
|
|||
static int
|
||||
is_leap_close(time_t t)
|
||||
{
|
||||
return t >= leap_when - LEAP_SECOND_CLOSE && t < leap_when + LEAP_SECOND_CLOSE;
|
||||
return leap_when != 0 &&
|
||||
t >= leap_when - LEAP_SECOND_CLOSE && t < leap_when + LEAP_SECOND_CLOSE;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
Loading…
Reference in a new issue