summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2012-08-29 18:17:06 -0700
committerColin Cross <ccross@android.com>2012-09-10 14:12:37 -0700
commit80f9867431af4632749890b24c0256f0ab07640d (patch)
tree13f3be854380ef73c7305b08c98cdadcb4fb8441 /fastboot
parent82959f5e46870cb57675d1ebba97294c56508949 (diff)
downloadsystem_core-80f9867431af4632749890b24c0256f0ab07640d.tar.gz
system_core-80f9867431af4632749890b24c0256f0ab07640d.tar.bz2
system_core-80f9867431af4632749890b24c0256f0ab07640d.zip
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')
-rw-r--r--fastboot/fastboot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index b6eab8cfc..c9def7b79 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -832,6 +832,11 @@ int main(int argc, char **argv)
return 0;
}
+ if (argc > 0 && !strcmp(*argv, "help")) {
+ usage();
+ return 0;
+ }
+
usb = open_device();
while (argc > 0) {
@@ -922,9 +927,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;