summaryrefslogtreecommitdiffstats
path: root/fastboot/fastboot.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2012-08-29 18:17:06 -0700
committerColin Cross <ccross@android.com>2012-08-29 18:21:06 -0700
commitc7b75dcc1aa121574d7677c97ff7d9b4ba91e624 (patch)
treee609e5cd2c49bd33240e1c0781005f0a604c00af /fastboot/fastboot.c
parent1182e61f76f3adf79d82622697ba07a267f4cf71 (diff)
downloadsystem_core-c7b75dcc1aa121574d7677c97ff7d9b4ba91e624.zip
system_core-c7b75dcc1aa121574d7677c97ff7d9b4ba91e624.tar.gz
system_core-c7b75dcc1aa121574d7677c97ff7d9b4ba91e624.tar.bz2
fastboot: move help command before usb connect
Move the help command handling before the call to open_device so that is doesn't block when no device is connected. Bug: 7078873 Change-Id: I4e9a4317bd72b4ceb4b9fc838eafd2e57b17a473
Diffstat (limited to 'fastboot/fastboot.c')
-rw-r--r--fastboot/fastboot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index 898d452..06a6a13 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -850,6 +850,11 @@ int main(int argc, char **argv)
return 0;
}
+ if (argc > 0 && !strcmp(*argv, "help")) {
+ usage();
+ return 0;
+ }
+
usb = open_device();
while (argc > 0) {
@@ -940,9 +945,6 @@ int main(int argc, char **argv)
wants_reboot = 1;
} else if(!strcmp(*argv, "oem")) {
argc = do_oem_command(argc, argv);
- } else if (!strcmp(*argv, "help")) {
- usage();
- return 0;
} else {
usage();
return 1;