]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: rename variable to match config name
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Feb 2021 13:01:56 +0000 (14:01 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Feb 2021 20:14:04 +0000 (21:14 +0100)
PollIntervalMinSec and PollIntervalMaxSec use the same pattern, but
RootDistanceMaxSec had switched orderd in the code.

src/timesync/timesyncd-bus.c
src/timesync/timesyncd-gperf.gperf
src/timesync/timesyncd-manager.c
src/timesync/timesyncd-manager.h

index c5ad5feb958e84ac42b9c56ba2590ec61fe657c9..1a14564e04624b6660499b62acd9ea96e1d67256 100644 (file)
@@ -165,7 +165,7 @@ static const sd_bus_vtable manager_vtable[] = {
         SD_BUS_PROPERTY("FallbackNTPServers", "as", property_get_servers, offsetof(Manager, fallback_servers), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("ServerName", "s", property_get_current_server_name, offsetof(Manager, current_server_name), 0),
         SD_BUS_PROPERTY("ServerAddress", "(iay)", property_get_current_server_address, offsetof(Manager, current_server_address), 0),
-        SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, max_root_distance_usec), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, root_distance_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("PollIntervalMinUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_min_usec), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("PollIntervalMaxUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("PollIntervalUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_usec), 0),
index 1a269957513337be6b5671903623cb6137f518a6..556a2e9ba866040f5c67b84e164099c83e2abe9d 100644 (file)
@@ -21,7 +21,7 @@ struct ConfigPerfItem;
 Time.NTP,                            config_parse_servers, SERVER_SYSTEM,   0
 Time.Servers,                        config_parse_servers, SERVER_SYSTEM,   0
 Time.FallbackNTP,                    config_parse_servers, SERVER_FALLBACK, 0
-Time.RootDistanceMaxSec,             config_parse_sec,     0,               offsetof(Manager, max_root_distance_usec)
+Time.RootDistanceMaxSec,             config_parse_sec,     0,               offsetof(Manager, root_distance_max_usec)
 Time.PollIntervalMinSec,             config_parse_sec,     0,               offsetof(Manager, poll_interval_min_usec)
 Time.PollIntervalMaxSec,             config_parse_sec,     0,               offsetof(Manager, poll_interval_max_usec)
 Time.ConnectionRetrySec,             config_parse_sec,     0,               offsetof(Manager, connection_retry_usec)
index 8c2ee4cbec8e749338a91e02e4b91c92b0126836..ed6bbb4c81c6fcfe85b075e467493774b55031f3 100644 (file)
@@ -34,7 +34,7 @@
 #define ADJ_SETOFFSET                   0x0100  /* add 'time' to current time */
 #endif
 
-/* expected accuracy of time synchronization; used to adjust the poll interval */
+/* Expected accuracy of time synchronization; used to adjust the poll interval */
 #define NTP_ACCURACY_SEC                0.2
 
 /*
@@ -45,7 +45,7 @@
 #define NTP_MAX_ADJUST                  0.4
 
 /* Default of maximum acceptable root distance in microseconds. */
-#define NTP_MAX_ROOT_DISTANCE           (5 * USEC_PER_SEC)
+#define NTP_ROOT_DISTANCE_MAX_USEC      (5 * USEC_PER_SEC)
 
 /* Maximum number of missed replies before selecting another source. */
 #define NTP_MAX_MISSED_REPLIES          2
@@ -507,7 +507,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
         }
 
         root_distance = ntp_ts_short_to_d(&ntpmsg.root_delay) / 2 + ntp_ts_short_to_d(&ntpmsg.root_dispersion);
-        if (root_distance > (double) m->max_root_distance_usec / (double) USEC_PER_SEC) {
+        if (root_distance > (double) m->root_distance_max_usec / (double) USEC_PER_SEC) {
                 log_info("Server has too large root distance. Disconnecting.");
                 return manager_connect(m);
         }
@@ -1081,7 +1081,7 @@ int manager_new(Manager **ret) {
         if (!m)
                 return -ENOMEM;
 
-        m->max_root_distance_usec = NTP_MAX_ROOT_DISTANCE;
+        m->root_distance_max_usec = NTP_ROOT_DISTANCE_MAX_USEC;
         m->poll_interval_min_usec = NTP_POLL_INTERVAL_MIN_USEC;
         m->poll_interval_max_usec = NTP_POLL_INTERVAL_MAX_USEC;
 
index af218a5f636c8c2833f13944c6a01e4c839c3d55..4aa7575a8029f877d39d424be12148609dfc3107 100644 (file)
@@ -79,7 +79,7 @@ struct Manager {
         } samples[8];
         unsigned samples_idx;
         double samples_jitter;
-        usec_t max_root_distance_usec;
+        usec_t root_distance_max_usec;
 
         /* last change */
         bool jumped;