app-comm-svc: fix to check aw_register()'s return value 10/87110/1
authorHongkuk, Son <hongkuk.son@samsung.com>
Tue, 6 Sep 2016 09:50:54 +0000 (18:50 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Tue, 6 Sep 2016 09:53:33 +0000 (18:53 +0900)
related with below two commits.
https://review.tizen.org/gerrit/#/c/86439/ ( argos_watchdog )
https://review.tizen.org/gerrit/#/c/86449/ ( app-comm-svc )

Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: I996aa957df4fc2d7fd8431995202c038c107283c

main.cpp

index 3609dbc..01964d5 100755 (executable)
--- a/main.cpp
+++ b/main.cpp
@@ -206,10 +206,15 @@ int main(void)
                                REMOTE_PRINT_DEBUG("Fail to create connection_set_type_changed_cb\n");
                        }
                        //REMOTE_PRINT_DEBUG("Start Convergence Manager!");
-                       aw_register(60);
+                       ret = aw_register(60);
 
-                       g_timeout_add(NOTIFY_TIME, watchdog_notify_callback, mainloop);
+                       if (ret < 0) {
+                               REMOTE_PRINT_DEBUG("Fail to register argos watchdog. ret is (%d)\n", ret);
+                       } else {
+                               REMOTE_PRINT_DEBUG("Success to register argos watchdog. ret is (%d)\n", ret);
 
+                               g_timeout_add(NOTIFY_TIME, watchdog_notify_callback, mainloop);
+                       }
 
                        // Run GMainLoop
                        REMOTE_PRINT_DEBUG("remote-server mainloop Start");