mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:45:07 -05:00
sys: allow drivers to fail when applying step offset
Different systems may consider different time values to be valid. Don't exit on settimeofday()/adjtimex() error in case the check in UTI_IsTimeOffsetSane() isn't restrictive enough.
This commit is contained in:
@@ -219,7 +219,7 @@ accrue_offset(double offset, double corr_rate)
|
||||
/* Positive offset means system clock is fast of true time, therefore
|
||||
step backwards */
|
||||
|
||||
static void
|
||||
static int
|
||||
apply_step_offset(double offset)
|
||||
{
|
||||
struct timeval old_time, new_time, rounded_new_time, T1;
|
||||
@@ -248,7 +248,8 @@ apply_step_offset(double offset)
|
||||
UTI_DiffTimevalsToDouble(&rounding_error, &rounded_new_time, &new_time);
|
||||
|
||||
if (settimeofday(&new_time, NULL) < 0) {
|
||||
LOG_FATAL(LOGF_SysSolaris, "settimeofday() failed");
|
||||
DEBUG_LOG(LOGF_SysSolaris, "settimeofday() failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
UTI_AddDoubleToTimeval(&T0, offset, &T1);
|
||||
@@ -257,6 +258,8 @@ apply_step_offset(double offset)
|
||||
offset_register += rounding_error;
|
||||
|
||||
start_adjust();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user