diff options
author | Tom Marshall <tdm@cyngn.com> | 2015-12-01 13:57:37 -0800 |
---|---|---|
committer | Tom Marshall <tdm@cyngn.com> | 2015-12-01 14:00:03 -0800 |
commit | 1a8d317ed023d33b19ff23ef35afdffa05e2717d (patch) | |
tree | 1e4a6f8ac7ab656b5c2c48941c68c6e698b8e85e /adb | |
parent | 52746ee475bf43616330195a01bb4daa6532c791 (diff) | |
download | system_core-1a8d317ed023d33b19ff23ef35afdffa05e2717d.zip system_core-1a8d317ed023d33b19ff23ef35afdffa05e2717d.tar.gz system_core-1a8d317ed023d33b19ff23ef35afdffa05e2717d.tar.bz2 |
adb: Fix recovery_mode
* adb_trace_init() exits early, put the banner check in main().
Change-Id: I83d0b83076a3d97fdec41b2cf02ee45805a53c6f
Diffstat (limited to 'adb')
-rw-r--r-- | adb/adb.cpp | 4 | ||||
-rw-r--r-- | adb/adb_main.cpp | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/adb/adb.cpp b/adb/adb.cpp index c2ac674..f64b19f 100644 --- a/adb/adb.cpp +++ b/adb/adb.cpp @@ -54,8 +54,6 @@ int HOST = 0; #if !ADB_HOST const char *adb_device_banner = "device"; - -int recovery_mode = 0; #endif void fatal(const char *fmt, ...) @@ -196,8 +194,6 @@ void adb_trace_init() { #if !ADB_HOST start_device_log(); - - recovery_mode = (strcmp(adb_device_banner, "recovery") == 0); #endif } diff --git a/adb/adb_main.cpp b/adb/adb_main.cpp index 1ff305b..4025fbe 100644 --- a/adb/adb_main.cpp +++ b/adb/adb_main.cpp @@ -361,6 +361,10 @@ void close_stdin() { } #endif +#if !ADB_HOST +int recovery_mode = 0; +#endif + // TODO(danalbert): Split this file up into adb_main.cpp and adbd_main.cpp. int main(int argc, char **argv) { #if ADB_HOST @@ -399,6 +403,8 @@ int main(int argc, char **argv) { } } + recovery_mode = (strcmp(adb_device_banner, "recovery") == 0); + close_stdin(); adb_trace_init(); |