summaryrefslogtreecommitdiffstats
path: root/src/timesync/timesyncd-manager.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-07 18:55:08 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-08 08:12:31 +0200
commit933e95d716394e806ae7aab674b3122c6f264d6c (patch)
tree413524dd8008a772f601100cbbe835f1be1b6c35 /src/timesync/timesyncd-manager.c
parentnetwork: check that bus is ready at one more place (diff)
downloadsystemd-933e95d716394e806ae7aab674b3122c6f264d6c.tar.xz
systemd-933e95d716394e806ae7aab674b3122c6f264d6c.zip
timesync: check that bus is ready before emitting property change
Diffstat (limited to '')
-rw-r--r--src/timesync/timesyncd-manager.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index 42b6c29d3b..cb5d42b1d3 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -607,7 +607,13 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_freq / 65536,
spike ? " (ignored)" : "");
- (void) sd_bus_emit_properties_changed(m->bus, "/org/freedesktop/timesync1", "org.freedesktop.timesync1.Manager", "NTPMessage", NULL);
+ if (sd_bus_is_ready(m->bus) > 0)
+ (void) sd_bus_emit_properties_changed(
+ m->bus,
+ "/org/freedesktop/timesync1",
+ "org.freedesktop.timesync1.Manager",
+ "NTPMessage",
+ NULL);
if (!m->good) {
_cleanup_free_ char *pretty = NULL;