libuuid: check clock value from LIBUUID_CLOCK_FILE

The clock value from the LIBUUID_CLOCK_FILE must be checked in
case of an update of libuuid. If clock==CLOCK_SEQ_CONT it must
be set to a new value.

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Michael Trapp 2022-08-02 14:16:43 +02:00 committed by su-fang
parent a29f1fcdf0
commit 43c4671759
1 changed files with 5 additions and 0 deletions

View File

@ -274,6 +274,11 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low,
last.tv_usec = tv2;
adjustment = a;
}
// reset in case of reserved CLOCK_SEQ_CONT
if (clock_seq == CLOCK_SEQ_CONT) {
last.tv_sec = 0;
last.tv_usec = 0;
}
}
if ((last.tv_sec == 0) && (last.tv_usec == 0)) {