From a09558c2e205771e6830eeb6241c5c0e3b1cf4ce Mon Sep 17 00:00:00 2001 From: Wenhao Li Date: Wed, 13 Nov 2013 16:23:37 +0800 Subject: [PATCH] Make server port option work on windows The server port command line option do not work on windows, need pass -P option to child process. Change-Id: Ibb3f0a926fae8e17c75fccbd4bb3a33318fffe9e --- adb/adb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adb/adb.c b/adb/adb.c index ec74b49d4..b7359d4f8 100644 --- a/adb/adb.c +++ b/adb/adb.c @@ -1077,10 +1077,11 @@ int launch_server(int server_port) /* get path of current program */ GetModuleFileName( NULL, program_path, sizeof(program_path) ); - + char args[64]; + snprintf(args, sizeof(args), "adb -P %d fork-server server", server_port); ret = CreateProcess( program_path, /* program path */ - "adb fork-server server", + args, /* the fork-server argument will set the debug = 2 in the child */ NULL, /* process handle is not inheritable */