[FIX] WSI workaround 86/48986/1
authorAlexander Aksenov <a.aksenov@samsung.com>
Fri, 2 Oct 2015 13:14:59 +0000 (16:14 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Fri, 2 Oct 2015 13:14:59 +0000 (16:14 +0300)
For long start applications

Change-Id: I79ed550ad3b0204f88ad77b1663afed1575b79d9
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
daemon/wsi.c

index b63f9e2..8b74a3c 100644 (file)
@@ -430,14 +430,22 @@ static void *handle_ws_responses(void *arg)
 static int wsi_init(const char *address, int port)
 {
        int res = 0;
+       int i = 0;
        if (!port) {
                char buf[sizeof(struct msg_t) + sizeof(uint32_t)];
                struct msg_t *msg = (struct msg_t *)buf;
 
                msg->id = NMSG_WRT_LAUNCHER_PORT;
                msg->len = sizeof(uint32_t);
-               if (!ioctl_send_msg(msg))
-                       port = *(int *)&msg->payload;
+
+               for (i = 0; i < 10; i++) {
+                       LOGI("Try %d\n", i);
+
+                       if (!ioctl_send_msg(msg)) {
+                               port = *(int *)&msg->payload;
+                               break;
+                       }
+               }
        }
 
        if (port) {