SDB: fix sdb error message 83/13083/5
authorho.namkoong <ho.namkoong@samsung.com>
Thu, 28 Nov 2013 02:47:51 +0000 (11:47 +0900)
committerho.namkoong <ho.namkoong@samsung.com>
Mon, 2 Dec 2013 01:17:07 +0000 (10:17 +0900)
when there are more than one device, error happend by -d option is modified

Change-Id: Ibdf5fea4e9c8e42752edbeaba530ebf7d1e22105
Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
src/sdb_constants.c
src/transport.c

index bc31029bdd6c3891234eebe8e031b6e378be57c2..db8f227023f4851f2645ddaf37d5a9b80747f264 100644 (file)
     const char* STATE_UNKNOWN = "unknown";
     const char* STATE_SUSPENDED = "suspended";
 
-    const char* TRANSPORT_ERR_MORE_THAN_ONE_TARGET = "more than one target";
-    const char* TRANSPORT_ERR_MORE_THAN_ONE_EMUL = "more than one emulator";
-    const char* TRANSPORT_ERR_MORE_THAN_ONE_CONNECT = "more than one connected emulator";
-    const char* TRANSPORT_ERR_MORE_THAN_ONE_DEV = "more than one device";
+    const char* TRANSPORT_ERR_MORE_THAN_ONE_TARGET = "There are more than one target. Please specify the target using -s option.";
+    const char* TRANSPORT_ERR_MORE_THAN_ONE_EMUL = "There are more than one emulator. Please specify the emulator using -s option.";
+    const char* TRANSPORT_ERR_MORE_THAN_ONE_DEV = "There are more than one device. Please specify the device using -s option.";
     const char* TRANSPORT_ERR_TARGET_OFFLINE = "target offline";
     const char* TRANSPORT_ERR_TARGET_SUSPENDED = "emulator is in suspended mode";
     const char* TRANSPORT_ERR_TARGET_NOT_FOUND = "target not found";
index 8c444ae38a2725e5c0fc9d5b01134833d231d625..cc0fc8f7269d94f811ce8005b41242a1e2f750b8 100755 (executable)
@@ -540,7 +540,7 @@ TRANSPORT *acquire_one_transport(transport_type ttype, const char* serial, char*
                 if (result) {
                     *error_out = (char*)TRANSPORT_ERR_MORE_THAN_ONE_TARGET;
                     result = NULL;
-                    break;
+                    goto exit;
                 }
                 result = transport_;
             }
@@ -554,19 +554,19 @@ TRANSPORT *acquire_one_transport(transport_type ttype, const char* serial, char*
                         *error_out = (char*)TRANSPORT_ERR_MORE_THAN_ONE_EMUL;
                     }
                     result = NULL;
-                    break;
+                    goto exit;
                 }
                 result = transport_;
             }
         }
     }
 
-    sdb_mutex_unlock(&transport_lock, "transport acquire_one_transport");
-
     if (result == NULL ) {
         *error_out = (char*)TRANSPORT_ERR_TARGET_NOT_FOUND;
     }
 
+exit:
+    sdb_mutex_unlock(&transport_lock, "transport acquire_one_transport");
     return result;
 }