From: Miroslav Lichvar Date: Thu, 4 Mar 2021 09:06:22 +0000 (+0100) Subject: cmdmon: return error if doffset command fails X-Git-Tag: 4.1-pre1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2117ab6973632483cb470c89697daabd32effde;p=thirdparty%2Fchrony.git cmdmon: return error if doffset command fails --- diff --git a/cmdmon.c b/cmdmon.c index fb0280d8..3d17cb74 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -858,9 +858,13 @@ static void handle_doffset(CMD_Request *rx_message, CMD_Reply *tx_message) { double doffset; + doffset = UTI_FloatNetworkToHost(rx_message->data.doffset.doffset); - LCL_AccumulateOffset(doffset, 0.0); - LOG(LOGS_INFO, "Accumulated delta offset of %.6f seconds", doffset); + if (!LCL_AccumulateOffset(doffset, 0.0)) { + tx_message->status = htons(STT_FAILED); + } else { + LOG(LOGS_INFO, "Accumulated delta offset of %.6f seconds", doffset); + } } /* ================================================== */