From: Kim Gunsoo Date: Thu, 23 Jun 2016 05:20:32 +0000 (+0900) Subject: Fixed the issue that sdb client is blocked for poweroff shell command. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1fac2032312caf63f11a87bf2d5db3b138118bf;p=sdk%2Ftools%2Fsdb.git Fixed the issue that sdb client is blocked for poweroff shell command. - When you run the poweroff shell command, Emulator is finished. However, since the shell routine of sdb client will try to get the capabiltiy information after the death of Emulator, take hang. - Change the capability to get in advance. Change-Id: I6877f344d4d1a795f30c6870c3873c22e2283125 Signed-off-by: Kim Gunsoo --- diff --git a/src/command_function.c b/src/command_function.c index 491e16a..9b38aeb 100644 --- a/src/command_function.c +++ b/src/command_function.c @@ -648,7 +648,9 @@ static int shell_connect_args(int argc, char ** argv) int shell(int argc, char ** argv) { int fd = -1; + int sync_winsz_support = SYNCWINSZ_UNSUPPORTED; + sync_winsz_support = check_syncwinsz_support(); if(argc < 2) { fd = shell_connect(); } else { @@ -659,7 +661,7 @@ int shell(int argc, char ** argv) { return 1; } - sdb_execute_shell(fd, SDB_STDIN_ON); + sdb_execute_shell(fd, SDB_STDIN_ON, sync_winsz_support); sdb_close(fd); return 0; diff --git a/src/commandline.c b/src/commandline.c index 4752751..d92f127 100755 --- a/src/commandline.c +++ b/src/commandline.c @@ -456,7 +456,7 @@ int match_capability_key_value(char* cap, char* key, char* value) { return matched; } -static int check_syncwinsz_support() { +int check_syncwinsz_support() { char full_cmd[16] = {0,}; char cap_buffer[CAPBUF_SIZE] = {0,}; uint16_t len = 0; @@ -490,16 +490,16 @@ static int check_syncwinsz_support() { return supported; } -static void stdin_info_init(int fd) +static void stdin_info_init(int fd, int enable_sync_winsz) { g_stdin_info.stdin_fd = INPUT_FD; g_stdin_info.remote_fd = fd; - g_stdin_info.enable_sync_winsz = check_syncwinsz_support(); + g_stdin_info.enable_sync_winsz = enable_sync_winsz; } -void sdb_execute_shell(int fd, int stdin_on) +void sdb_execute_shell(int fd, int stdin_on, int enable_sync_winsz) { - stdin_info_init(fd); + stdin_info_init(fd, enable_sync_winsz); if (stdin_on == SDB_STDIN_ON) { sdb_thread_t thr; diff --git a/src/commandline.h b/src/commandline.h index 72f78ab..8f5784e 100644 --- a/src/commandline.h +++ b/src/commandline.h @@ -67,7 +67,8 @@ void read_and_dump(int fd); int interactive_shell(); int is_support_eshell(struct sdb_version *pversion); int get_screensize(int* lines, int* columns); -void sdb_execute_shell(int fd, int stdin_on); +void sdb_execute_shell(int fd, int stdin_on, int enable_sync_winsz); +int check_syncwinsz_support(void); int get_server_port(); int get_platform_version(struct sdb_version *pversion); int __sdb_command(const char* cmd);