mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 23:25:06 -05:00
sources: add minsources option
This sets the minimum number of selectable sources needed to update the local clock.
This commit is contained in:
13
conf.c
13
conf.c
@@ -135,6 +135,9 @@ static double make_step_threshold = 0.0;
|
||||
/* Threshold for automatic RTC trimming */
|
||||
static double rtc_autotrim_threshold = 0.0;
|
||||
|
||||
/* Minimum number of selectables sources required to update the clock */
|
||||
static int min_sources = 1;
|
||||
|
||||
/* Number of updates before offset checking, number of ignored updates
|
||||
before exiting and the maximum allowed offset */
|
||||
static int max_offset_delay = -1;
|
||||
@@ -456,6 +459,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
||||
parse_double(p, &max_update_skew);
|
||||
} else if (!strcasecmp(command, "minsamples")) {
|
||||
parse_int(p, &min_samples);
|
||||
} else if (!strcasecmp(command, "minsources")) {
|
||||
parse_int(p, &min_sources);
|
||||
} else if (!strcasecmp(command, "noclientlog")) {
|
||||
no_client_log = parse_null(p);
|
||||
} else if (!strcasecmp(command, "peer")) {
|
||||
@@ -1700,6 +1705,14 @@ CNF_GetMinSamples(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
CNF_GetMinSources(void)
|
||||
{
|
||||
return min_sources;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
char *
|
||||
CNF_GetHwclockFile(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user