Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/android/forwarder2/host_forwarder_main.cc

Issue 11148018: Upstream the android python scripts changes that enable the new Forwarder2 to be used in our test f… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/forwarder2/host_controller.cc ('k') | tools/android/forwarder2/socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/host_forwarder_main.cc
diff --git a/tools/android/forwarder2/host_forwarder_main.cc b/tools/android/forwarder2/host_forwarder_main.cc
index 1b3bf5d8264456132752fbdaa526870042652716..6e541894cead6671d1a3e7b97d85a11976bc92f9 100644
--- a/tools/android/forwarder2/host_forwarder_main.cc
+++ b/tools/android/forwarder2/host_forwarder_main.cc
@@ -39,7 +39,7 @@ void KillHandler(int /* unused */) {
// (non-nicely). This is useful when debugging.
++s_kill_handler_count;
if (!g_notifier->Notify() || s_kill_handler_count > 2)
- exit(-1);
+ exit(1);
}
// Format of arg: <Device port>[:<Forward to port>:<Forward to address>]
@@ -77,6 +77,11 @@ int main(int argc, char** argv) {
printf("Could not parse adb port number: %s\n", adb_port_str.c_str());
show_help = true;
}
+ if (adb_port <= 0) {
+ printf("Invalid adb port number: %s. Adb port must be a "
+ "postivie integer.\n", adb_port_str.c_str());
+ show_help = true;
+ }
CommandLine::StringVector forward_args = command_line.GetArgs();
if (show_help || forward_args.empty()) {
tools::ShowHelp(
@@ -89,7 +94,7 @@ int main(int argc, char** argv) {
" <Forward to port> default is <Device port>\n"
" <Forward to address> default is 127.0.0.1.",
kDefaultAdbPort).c_str());
- return 0;
+ return 1;
}
g_notifier = new forwarder2::PipeNotifier();
« no previous file with comments | « tools/android/forwarder2/host_controller.cc ('k') | tools/android/forwarder2/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698