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

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

Issue 11038005: Enable forwarder2 for all our tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
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..5ba02a25d3f828f27a21fe08f775d6c84f78472b 100644
--- a/tools/android/forwarder2/host_forwarder_main.cc
+++ b/tools/android/forwarder2/host_forwarder_main.cc
@@ -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;
Philippe 2012/10/01 22:38:06 Sorry to catch this only now. main()'s exit code i
felipeg 2012/10/01 22:42:41 Yep, the return value doesn't matter here. I just
Isaac (away) 2012/10/01 22:45:37 Please change this to a positive value.
}
g_notifier = new forwarder2::PipeNotifier();

Powered by Google App Engine
This is Rietveld 408576698