summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-09-18 22:28:32 +0200
committerTao Bao <tbao@google.com>2019-09-19 01:12:59 +0200
commitff185865fd8c634c009b8caa1cc18bffe89f023f (patch)
tree4f9b2cfc25a9a860d649aa54a4ec4dc05ead3fbf
parentMerge "Update the instruction for building recovery image on Pixels." (diff)
downloadandroid_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar.gz
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar.bz2
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar.lz
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar.xz
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.tar.zst
android_bootable_recovery-ff185865fd8c634c009b8caa1cc18bffe89f023f.zip
Diffstat (limited to '')
-rw-r--r--recovery_main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 28197bf40..a04c1bbae 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -351,6 +351,12 @@ int main(int argc, char** argv) {
std::string locale;
std::string reason;
+ // The code here is only interested in the options that signal the intent to start fastbootd or
+ // recovery. Unrecognized options are likely meant for recovery, which will be processed later in
+ // start_recovery(). Suppress the warnings for such -- even if some flags were indeed invalid, the
+ // code in start_recovery() will capture and report them.
+ opterr = 0;
+
int arg;
int option_index;
while ((arg = getopt_long(args_to_parse.size() - 1, args_to_parse.data(), "", OPTIONS,
@@ -374,6 +380,7 @@ int main(int argc, char** argv) {
}
}
optind = 1;
+ opterr = 1;
if (locale.empty()) {
if (HasCache()) {