Fixed a bug that interative shell with syncwinsz does not work as eclipse external...
authorshingil.kang <shingil.kang@samsung.com>
Wed, 13 Jan 2016 09:20:05 +0000 (18:20 +0900)
committershingil.kang <shingil.kang@samsung.com>
Thu, 14 Jan 2016 06:09:47 +0000 (15:09 +0900)
Change-Id: I14a3f218e124d9a4457b8fa073b8f176aa73f819
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
src/commandline.c

index 304fef40da3bb992f463f06921f1df01618603fa..abe6ee7dea5018dc51feb9b1898aea30db01f99f 100755 (executable)
@@ -492,22 +492,20 @@ int interactive_shell()
     patch = MK_PLATFORM_PATCH(version);
 
     // eshell to support from the 2.4.0 version.
-    if (major >= 3 || (major >= 2 && minor >=4)) {
-        if(get_screensize(&lines, &columns) == 0) {
-            snprintf(eshell+7, sizeof(eshell)-7, "%d:%d", lines, columns);
-            D("interactive shell : eshell command=%s\n", eshell);
-            fd = sdb_connect(eshell);
-            if(fd < 0) {
-                fprintf(stdout, "failed environment shell, so it will retry shell command.\n");
-                return 1;
-            }
+    if ((major >= 3 || (major >= 2 && minor >=4)) && (get_screensize(&lines, &columns) == 0)) {
+        snprintf(eshell+7, sizeof(eshell)-7, "%d:%d", lines, columns);
+        D("interactive shell : eshell command=%s\n", eshell);
+        fd = sdb_connect(eshell);
+        if(fd < 0) {
+            fprintf(stdout, "failed environment shell, so it will retry shell command.\n");
         }
-
         if(check_syncwinsz_support() == 1) {
             D("Support sync window size with remote\n");
             enable_sync_winsz = 1;
         }
-    } else {
+    }
+
+    if (fd < 0) {
         fd = sdb_connect("shell:");
         if(fd < 0) {
             return 1;