Skip to content

Commit

Permalink
clock: Print info message when leap flags change.
Browse files Browse the repository at this point in the history
Log an info message when the LEAP_61 or LEAP_59 flag changes in the
accepted time properties.

Signed-off-by: Miroslav Lichvar <[email protected]>
  • Loading branch information
mlichvar authored and richardcochran committed Sep 27, 2021
1 parent 130769d commit ee70be8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,11 @@ struct timePropertiesDS clock_time_properties(struct clock *c)

void clock_update_time_properties(struct clock *c, struct timePropertiesDS tds)
{
if ((tds.flags ^ c->tds.flags) & (LEAP_61 | LEAP_59)) {
pr_info("updating time properties to %s leap second",
tds.flags & (LEAP_61 | LEAP_59) ?
(tds.flags & LEAP_61 ? "insert" : "delete") : "no");
}
if ((tds.flags & UTC_OFF_VALID && tds.flags & TIME_TRACEABLE &&
tds.currentUtcOffset != c->utc_offset) ||
tds.currentUtcOffset > c->utc_offset) {
Expand Down

0 comments on commit ee70be8

Please sign in to comment.