ECS: log path is moved to under coresponding instance's logs folder 27/15427/1
authorJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 21 Jan 2014 05:21:05 +0000 (14:21 +0900)
committerJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 21 Jan 2014 05:21:05 +0000 (14:21 +0900)
Change-Id: Ie3e5e961b00d8e6f96176844ebceef7011eed928
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
tizen/src/ecs/ecs.c

index c5ff2ef..ad6c4a8 100644 (file)
@@ -92,11 +92,15 @@ static char* get_emulator_ecs_log_path(void)
     gchar *emulator_ecs_log_path = NULL;
     gchar *tizen_sdk_data = NULL;
 #ifndef CONFIG_WIN32
-    char emulator_ecs[] = "/emulator/vms/ecs.log";
+    char emulator_ecs[] = "/emulator/vms/";
+    char ecs_prop[] = "/logs/ecs.log";
 #else
-    char emulator_ecs[] = "\\emulator\\vms\\ecs.log";
+    char emulator_ecs[] = "\\emulator\\vms\\";
+    char ecs_prop[] = "\\logs\\ecs.log";
 #endif
 
+    char* emul_name = get_emul_vm_name();
+
     tizen_sdk_data = get_tizen_sdk_data_path();
     if (!tizen_sdk_data) {
         LOG("failed to get tizen-sdk-data path.\n");
@@ -104,14 +108,14 @@ static char* get_emulator_ecs_log_path(void)
     }
 
     emulator_ecs_log_path =
-        g_malloc(strlen(tizen_sdk_data) + sizeof(emulator_ecs) + 1);
+        g_malloc(strlen(tizen_sdk_data) + sizeof(emulator_ecs) + strlen(emul_name) + sizeof(ecs_prop) + 1);
     if (!emulator_ecs_log_path) {
         LOG("failed to allocate memory.\n");
         return NULL;
     }
 
-    g_snprintf(emulator_ecs_log_path, strlen(tizen_sdk_data) + sizeof(emulator_ecs),
-             "%s%s", tizen_sdk_data, emulator_ecs);
+    g_snprintf(emulator_ecs_log_path, strlen(tizen_sdk_data) + sizeof(emulator_ecs) + strlen(emul_name) + sizeof(ecs_prop),
+             "%s%s%s%s", tizen_sdk_data, emulator_ecs, emul_name, ecs_prop);
 
     g_free(tizen_sdk_data);
 
@@ -747,6 +751,9 @@ static int ecs_loop(ECS_State *cs)
     }
 
     for (index = 0; index < cs->reads.fd_count; index++) {
+        if (cs->reads.fd_array == NULL)
+            continue;
+
         if (FD_ISSET(cs->reads.fd_array[index], &temps)) {
             if (cs->reads.fd_array[index] == cs->listen_fd) {
                 ecs_accept(cs);