Revert "Make adb's daemon-port on the host machine configurable."
Fix the build.
This reverts commit 5a00fd1c5542b302e5534d7c424ee92da3d6bceb.
diff --git a/adb/adb.c b/adb/adb.c
index f12120f..a34dd71 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -693,7 +693,7 @@
#endif
#if ADB_HOST
-int launch_server(int server_port)
+int launch_server()
{
#ifdef HAVE_WIN32_PROC
/* we need to start the server in the background */
@@ -828,17 +828,7 @@
}
#endif
-/* Constructs a local name of form tcp:port.
- * target_str points to the target string, it's content will be overwritten.
- * target_size is the capacity of the target string.
- * server_port is the port number to use for the local name.
- */
-void build_local_name(char* target_str, size_t target_size, int server_port)
-{
- snprintf(target_str, target_size, "tcp:%d", server_port);
-}
-
-int adb_main(int is_daemon, int server_port)
+int adb_main(int is_daemon)
{
#if !ADB_HOST
int secure = 0;
@@ -861,11 +851,9 @@
HOST = 1;
usb_vendors_init();
usb_init();
- local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);
+ local_init(ADB_LOCAL_TRANSPORT_PORT);
- char local_name[30];
- build_local_name(local_name, sizeof(local_name), server_port);
- if(install_listener(local_name, "*smartsocket*", NULL)) {
+ if(install_listener("tcp:5037", "*smartsocket*", NULL)) {
exit(1);
}
#else
@@ -891,7 +879,7 @@
}
}
- /* don't listen on a port (default 5037) if running in secure mode */
+ /* don't listen on port 5037 if we are running in secure mode */
/* don't run as root if we are running in secure mode */
if (secure) {
struct __user_cap_header_struct header;
@@ -924,11 +912,9 @@
cap.inheritable = 0;
capset(&header, &cap);
- D("Local port disabled\n");
+ D("Local port 5037 disabled\n");
} else {
- char[30] local_name;
- build_local_name(local_name, sizeof(local_name), server_port);
- if(install_listener(&local_name, "*smartsocket*", NULL)) {
+ if(install_listener("tcp:5037", "*smartsocket*", NULL)) {
exit(1);
}
}