Allow sdb to listen on both usb and TCP.
[sdk/target/sdbd.git] / src / sdb.c
index 90f4cfa..0ab561a 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1232,11 +1232,12 @@ int sdb_main(int is_daemon, int server_port)
     if (!is_emulator()) {
         // listen on USB
         usb_init();
-        // listen on tcp
-        //local_init(DEFAULT_SDB_LOCAL_TRANSPORT_PORT);
-    } else {
-        // listen on default port
-        local_init(DEFAULT_SDB_LOCAL_TRANSPORT_PORT);
+    }
+
+    /* by default don't listen on local transport but
+     * listen if suitable command line argument has been provided */
+    if (sdbd_commandline_args.sdbd_port >= 0) {
+        local_init(sdbd_commandline_args.sdbd_port);
     }
 
 #if 0 /* tizen specific */