mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
cmdmon: fix doffset command with negative values on 64-bit systems
This commit is contained in:
4
cmdmon.c
4
cmdmon.c
@@ -1378,8 +1378,8 @@ handle_doffset(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
{
|
||||
long sec, usec;
|
||||
double doffset;
|
||||
sec = (long)(ntohl(rx_message->data.doffset.sec));
|
||||
usec = (long)(ntohl(rx_message->data.doffset.usec));
|
||||
sec = (int32_t)ntohl(rx_message->data.doffset.sec);
|
||||
usec = (int32_t)ntohl(rx_message->data.doffset.usec);
|
||||
doffset = (double) sec + 1.0e-6 * (double) usec;
|
||||
LOG(LOGS_INFO, LOGF_CmdMon, "Accumulated delta offset of %.6f seconds", doffset);
|
||||
LCL_AccumulateOffset(doffset, 0.0);
|
||||
|
||||
Reference in New Issue
Block a user