All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] clock: fix time update transition auto->manual
@ 2022-04-18 19:34 Ryan Smith
  2022-04-18 19:40 ` [PATCH v2] " Ryan Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Smith @ 2022-04-18 19:34 UTC (permalink / raw)
  To: connman; +Cc: Ryan Smith

When the TimeUpdates property is changed via D-Bus from auto to manual,
the change is written out to the settings state file. However, it does
no modify the current service. This causes the service to continue to
synchronize time even after TimeUpdates being set to manual. This patch
updates the service whenever any change is made to the TimeUpdates setting.
---
 src/clock.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/clock.c b/src/clock.c
index 906538ac..365c49a1 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -290,12 +290,8 @@ static DBusMessage *set_property(DBusConnection *conn,
 				CONNMAN_CLOCK_INTERFACE, "TimeUpdates",
 				DBUS_TYPE_STRING, &strval);
 
-		if (newval == TIME_UPDATES_AUTO) {
-			struct connman_service *service;
-
-			service = connman_service_get_default();
-			__connman_timeserver_conf_update(service);
-		}
+		service = connman_service_get_default();
+		__connman_timeserver_conf_update(service);
 	} else if (g_str_equal(name, "Timezone")) {
 		const char *strval;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] clock: fix time update transition auto->manual
  2022-04-18 19:34 [PATCH v1] clock: fix time update transition auto->manual Ryan Smith
@ 2022-04-18 19:40 ` Ryan Smith
  2022-05-16  6:50   ` Daniel Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Smith @ 2022-04-18 19:40 UTC (permalink / raw)
  To: connman; +Cc: Ryan Smith

When the TimeUpdates property is changed via D-Bus from auto to manual,
the change is written out to the settings state file. However, it does
no modify the current service. This causes the service to continue to
synchronize time even after TimeUpdates being set to manual. This patch
updates the service whenever any change is made to the TimeUpdates setting.
---
 src/clock.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/clock.c b/src/clock.c
index 906538ac..54ac274a 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -270,6 +270,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 	} else if (g_str_equal(name, "TimeUpdates")) {
 		const char *strval;
 		enum time_updates newval;
+		struct connman_service *service;
 
 		if (type != DBUS_TYPE_STRING)
 			return __connman_error_invalid_arguments(msg);
@@ -290,12 +291,8 @@ static DBusMessage *set_property(DBusConnection *conn,
 				CONNMAN_CLOCK_INTERFACE, "TimeUpdates",
 				DBUS_TYPE_STRING, &strval);
 
-		if (newval == TIME_UPDATES_AUTO) {
-			struct connman_service *service;
-
-			service = connman_service_get_default();
-			__connman_timeserver_conf_update(service);
-		}
+		service = connman_service_get_default();
+		__connman_timeserver_conf_update(service);
 	} else if (g_str_equal(name, "Timezone")) {
 		const char *strval;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] clock: fix time update transition auto->manual
  2022-04-18 19:40 ` [PATCH v2] " Ryan Smith
@ 2022-05-16  6:50   ` Daniel Wagner
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Wagner @ 2022-05-16  6:50 UTC (permalink / raw)
  To: Ryan Smith; +Cc: connman

Hi Ryan,

On Mon, Apr 18, 2022 at 01:40:38PM -0600, Ryan Smith wrote:
> When the TimeUpdates property is changed via D-Bus from auto to manual,
> the change is written out to the settings state file. However, it does
> no modify the current service. This causes the service to continue to
> synchronize time even after TimeUpdates being set to manual. This patch
> updates the service whenever any change is made to the TimeUpdates setting.

Seems reasonable to do. Patch applied.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-16  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 19:34 [PATCH v1] clock: fix time update transition auto->manual Ryan Smith
2022-04-18 19:40 ` [PATCH v2] " Ryan Smith
2022-05-16  6:50   ` Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.