From: munkyu.im Date: Wed, 16 Jan 2013 11:58:31 +0000 (+0900) Subject: emulator: change shared memory value X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7bba042c0957d250ec01e3c8b17325416987041e;p=sdk%2Femulator%2Fqemu.git emulator: change shared memory value It includes image name now. It helps to check same instance in detail. Signed-off-by: munkyu.im --- diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index c6a8601ff6..01a914ab6c 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -86,6 +86,7 @@ MULTI_DEBUG_CHANNEL(qemu, main); int tizen_base_port; char tizen_target_path[MAXLEN]; +char tizen_target_img_path[MAXLEN]; char logpath[MAXLEN]; static int _skin_argc; @@ -136,7 +137,7 @@ void check_shdmem(void) INFO("count of process that use shared memory : %d\n", shm_info.shm_nattch); if ((shm_info.shm_nattch > 0) && - strcmp(tizen_target_path, (char *)shm_addr) == 0) { + strcmp(tizen_target_img_path, (char *)shm_addr) == 0) { if (check_port_bind_listen(port + 1) > 0) { shmdt(shm_addr); continue; @@ -171,7 +172,7 @@ void check_shdmem(void) CloseHandle(hMapFile); } - if (strcmp(pBuf, tizen_target_path) == 0) { + if (strcmp(pBuf, tizen_target_img_path) == 0) { maru_register_exit_msg(MARU_EXIT_UNKNOWN, "Can not execute this VM.\n" "The same name is running now."); @@ -209,7 +210,7 @@ void make_shdmem(void) ERR("shmat failed\n"); return; } - sprintf(shared_memory, "%s", tizen_target_path); + sprintf(shared_memory, "%s", tizen_target_img_path); INFO("shared memory key: %d value: %s\n", tizen_base_port, (char *)shared_memory); #elif defined(CONFIG_WIN32) @@ -218,7 +219,7 @@ void make_shdmem(void) char *port_in_use; char *shared_memory; - shared_memory = g_strdup_printf("%s", tizen_target_path); + shared_memory = g_strdup_printf("%s", tizen_target_img_path); port_in_use = g_strdup_printf("%d", tizen_base_port); hMapFile = CreateFileMapping( INVALID_HANDLE_VALUE, /* use paging file */ @@ -399,7 +400,8 @@ void set_image_and_log_path(char *qemu_argv) } else { strcpy(tizen_target_path, g_path_get_dirname(path)); } - + strcpy(tizen_target_img_path, path); + free(path); strcpy(logpath, tizen_target_path); strcat(logpath, LOGS_SUFFIX); #ifdef CONFIG_WIN32