X Tutup
Skip to content

Commit 403db47

Browse files
committed
timesync: rename variable to match config name
PollIntervalMinSec and PollIntervalMaxSec use the same pattern, but RootDistanceMaxSec had switched orderd in the code.
1 parent c91ebcd commit 403db47

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/timesync/timesyncd-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static const sd_bus_vtable manager_vtable[] = {
165165
SD_BUS_PROPERTY("FallbackNTPServers", "as", property_get_servers, offsetof(Manager, fallback_servers), SD_BUS_VTABLE_PROPERTY_CONST),
166166
SD_BUS_PROPERTY("ServerName", "s", property_get_current_server_name, offsetof(Manager, current_server_name), 0),
167167
SD_BUS_PROPERTY("ServerAddress", "(iay)", property_get_current_server_address, offsetof(Manager, current_server_address), 0),
168-
SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, max_root_distance_usec), SD_BUS_VTABLE_PROPERTY_CONST),
168+
SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, root_distance_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
169169
SD_BUS_PROPERTY("PollIntervalMinUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_min_usec), SD_BUS_VTABLE_PROPERTY_CONST),
170170
SD_BUS_PROPERTY("PollIntervalMaxUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
171171
SD_BUS_PROPERTY("PollIntervalUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_usec), 0),

src/timesync/timesyncd-gperf.gperf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct ConfigPerfItem;
2121
Time.NTP, config_parse_servers, SERVER_SYSTEM, 0
2222
Time.Servers, config_parse_servers, SERVER_SYSTEM, 0
2323
Time.FallbackNTP, config_parse_servers, SERVER_FALLBACK, 0
24-
Time.RootDistanceMaxSec, config_parse_sec, 0, offsetof(Manager, max_root_distance_usec)
24+
Time.RootDistanceMaxSec, config_parse_sec, 0, offsetof(Manager, root_distance_max_usec)
2525
Time.PollIntervalMinSec, config_parse_sec, 0, offsetof(Manager, poll_interval_min_usec)
2626
Time.PollIntervalMaxSec, config_parse_sec, 0, offsetof(Manager, poll_interval_max_usec)
2727
Time.ConnectionRetrySec, config_parse_sec, 0, offsetof(Manager, connection_retry_usec)

src/timesync/timesyncd-manager.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
3535
#endif
3636

37-
/* expected accuracy of time synchronization; used to adjust the poll interval */
37+
/* Expected accuracy of time synchronization; used to adjust the poll interval */
3838
#define NTP_ACCURACY_SEC 0.2
3939

4040
/*
@@ -45,7 +45,7 @@
4545
#define NTP_MAX_ADJUST 0.4
4646

4747
/* Default of maximum acceptable root distance in microseconds. */
48-
#define NTP_MAX_ROOT_DISTANCE (5 * USEC_PER_SEC)
48+
#define NTP_ROOT_DISTANCE_MAX_USEC (5 * USEC_PER_SEC)
4949

5050
/* Maximum number of missed replies before selecting another source. */
5151
#define NTP_MAX_MISSED_REPLIES 2
@@ -507,7 +507,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
507507
}
508508

509509
root_distance = ntp_ts_short_to_d(&ntpmsg.root_delay) / 2 + ntp_ts_short_to_d(&ntpmsg.root_dispersion);
510-
if (root_distance > (double) m->max_root_distance_usec / (double) USEC_PER_SEC) {
510+
if (root_distance > (double) m->root_distance_max_usec / (double) USEC_PER_SEC) {
511511
log_info("Server has too large root distance. Disconnecting.");
512512
return manager_connect(m);
513513
}
@@ -1081,7 +1081,7 @@ int manager_new(Manager **ret) {
10811081
if (!m)
10821082
return -ENOMEM;
10831083

1084-
m->max_root_distance_usec = NTP_MAX_ROOT_DISTANCE;
1084+
m->root_distance_max_usec = NTP_ROOT_DISTANCE_MAX_USEC;
10851085
m->poll_interval_min_usec = NTP_POLL_INTERVAL_MIN_USEC;
10861086
m->poll_interval_max_usec = NTP_POLL_INTERVAL_MAX_USEC;
10871087

src/timesync/timesyncd-manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct Manager {
7979
} samples[8];
8080
unsigned samples_idx;
8181
double samples_jitter;
82-
usec_t max_root_distance_usec;
82+
usec_t root_distance_max_usec;
8383

8484
/* last change */
8585
bool jumped;

0 commit comments

Comments
 (0)
X Tutup