From 8f4ec5d095bd65a8361bf85b59a5c91f7f19409e Mon Sep 17 00:00:00 2001 From: Jinhyung Choi Date: Tue, 21 Jan 2014 14:21:05 +0900 Subject: [PATCH] ECS: log path is moved to under coresponding instance's logs folder Change-Id: Ie3e5e961b00d8e6f96176844ebceef7011eed928 Signed-off-by: Jinhyung Choi --- tizen/src/ecs/ecs.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tizen/src/ecs/ecs.c b/tizen/src/ecs/ecs.c index c5ff2ef7a9..ad6c4a8e94 100644 --- a/tizen/src/ecs/ecs.c +++ b/tizen/src/ecs/ecs.c @@ -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); -- 2.34.1