timedate: fix emitted value when ntp client is enabled/disabled (#11951)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 10 Mar 2019 19:44:21 +0000 (04:44 +0900)
committerMartin Pitt <martinpitt@users.noreply.github.com>
Sun, 10 Mar 2019 19:44:21 +0000 (20:44 +0100)
This fixes a regression originall caused by cf3872bd2 and
triggered by b4356b5720a.

Fixes #11944

src/timedate/timedated.c

index eeb17b6..324d4a4 100644 (file)
@@ -377,9 +377,9 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *er
                         n += !!u->path;
 
         if (n == 0) {
-                (void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m), "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP", NULL);
-
                 c->slot_job_removed = sd_bus_slot_unref(c->slot_job_removed);
+
+                (void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m), "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP", NULL);
         }
 
         return 0;