Apply device_notify_once() 57/199257/2
authorHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 8 Feb 2019 02:02:25 +0000 (11:02 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 8 Feb 2019 02:04:13 +0000 (11:04 +0900)
Change-Id: Ic56422e699bd3b1bae9174d31b271c40c7c5e907
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/core/main.c
src/power/power-handler.c

index 64d44c8..a2ece6b 100644 (file)
@@ -71,8 +71,9 @@ static void deviced_dbus_name_acquired(GDBusConnection *connection, const gchar
        int ret;
        ret = booting_finished();
        if (ret == 1) {
+               /* Restarted: deviced was terminated */
                _I("notify relaunch");
-               device_notify(DEVICE_NOTIFIER_BOOTING_DONE, &ret);
+               device_notify_once(DEVICE_NOTIFIER_BOOTING_DONE, &ret);
        }
 
        _I("sd_notify(READY=1)");
@@ -94,9 +95,8 @@ static int deviced_main(int argc, char **argv)
 
        ret = check_power_flag();
        if (ret) {
-               /* assume reboot was requested and deviced was
-                * killed/terminated in middle of it - resume
-                * procedure
+               /* Restarted: deviced was terminated
+                * in middle of reboot/poweroff - resume procedure
                 */
                poweroff_procedure();
                return 0;
index a084cc7..9b82c50 100644 (file)
@@ -259,7 +259,6 @@ static void poweroff_direct(void)
 
 int poweroff_procedure(void)
 {
-
        powerdown();
 
        if (poweroff_opt.type == POWER_OFF_DIRECT)