in chrony-candm/src/common.rs [166:188]
fn deserialize_unchecked<B: Buf>(buf: &mut B) -> Result<Self, DeserializationError> {
let secs_high_orig = buf.get_i32();
let secs_low = buf.get_u32();
let nsecs = buf.get_u32();
let secs_high = if secs_high_orig == i32::MAX {
0
} else {
secs_high_orig
};
if secs_high >= 0 {
let d = Duration::from_secs((secs_high as u64) << 32)
+ Duration::from_secs(secs_low as u64)
+ Duration::from_nanos(nsecs as u64);
Ok(UNIX_EPOCH + d)
} else {
let d = Duration::from_secs(((-secs_high) as u64) << 32)
- Duration::from_secs(secs_low as u64)
- Duration::from_nanos(nsecs as u64);
Ok(UNIX_EPOCH - d)
}
}