diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
commit | ad8b7d9e228c894c12cc061770b1a39d037e90ab (patch) | |
tree | d5bee8d23cb0a8de0d2fcab6b74d5becc8598296 /refclock.c | |
parent | Adding upstream version 4.5. (diff) | |
download | chrony-ad8b7d9e228c894c12cc061770b1a39d037e90ab.tar.xz chrony-ad8b7d9e228c894c12cc061770b1a39d037e90ab.zip |
Adding upstream version 4.6.upstream/4.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'refclock.c')
-rw-r--r-- | refclock.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -166,8 +166,8 @@ RCL_AddRefclock(RefclockParameters *params) if (!inst->driver->init && !inst->driver->poll) LOG_FATAL("refclock driver %s is not compiled in", params->driver_name); - if (params->tai && !CNF_GetLeapSecTimezone()) - LOG_FATAL("refclock tai option requires leapsectz"); + if (params->tai && !CNF_GetLeapSecList() && !CNF_GetLeapSecTimezone()) + LOG_FATAL("refclock tai option requires leapseclist or leapsectz"); inst->data = NULL; inst->driver_parameter = Strdup(params->driver_parameter); @@ -321,6 +321,22 @@ RCL_ReportSource(RPT_SourceReport *report, struct timespec *now) } } +int +RCL_ModifyOffset(uint32_t ref_id, double offset) +{ + unsigned int i; + + for (i = 0; i < ARR_GetSize(refclocks); i++) { + RCL_Instance inst = get_refclock(i); + if (inst->ref_id == ref_id) { + inst->offset = offset; + LOG(LOGS_INFO, "Source %s new offset %f", UTI_RefidToString(ref_id), offset); + return 1; + } + } + return 0; +} + void RCL_SetDriverData(RCL_Instance instance, void *data) { |