ilmControl: move eventfd init to init_control()
authorMarcus Fritzsch <marcus.fritzsch@xse.de>
Tue, 5 Aug 2014 11:36:21 +0000 (13:36 +0200)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 1 Sep 2014 06:55:43 +0000 (15:55 +0900)
Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c

index 3aae4c5..faf8b99 100644 (file)
@@ -1097,14 +1097,6 @@ ilmControl_init(t_ilm_nativedisplay nativedisplay)
        pthread_mutexattr_destroy(&a);
     }
 
-    ctx->shutdown_fd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
-
-    if (ctx->shutdown_fd == -1)
-    {
-        fprintf(stderr, "Could not setup shutdown-fd: %s\n", strerror(errno));
-        return ILM_FAILED;
-    }
-
     return init_control() == 0 ? ILM_SUCCESS : ILM_FAILED;
 }
 
@@ -1207,6 +1199,14 @@ init_control(void)
         return -1;
     }
 
+    ctx->shutdown_fd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
+
+    if (ctx->shutdown_fd == -1)
+    {
+        fprintf(stderr, "Could not setup shutdown-fd: %s\n", strerror(errno));
+        return ILM_FAILED;
+    }
+
     ret = pthread_create(&ctx->thread, NULL, control_thread, NULL);
 
     if (ret != 0) {