summaryrefslogtreecommitdiffstats
path: root/init/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'init/init.cpp')
-rw-r--r--init/init.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/init/init.cpp b/init/init.cpp
index 402331b..8ea42ca 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -642,7 +642,7 @@ static int wait_for_coldboot_done_action(int nargs, char **args) {
// Any longer than 1s is an unreasonable length of time to delay booting.
// If you're hitting this timeout, check that you didn't make your
// sepolicy regular expressions too expensive (http://b/19899875).
- if (wait_for_file(COLDBOOT_DONE, 1)) {
+ if (wait_for_file(COLDBOOT_DONE, 5)) {
ERROR("Timed out waiting for %s\n", COLDBOOT_DONE);
}
@@ -1012,8 +1012,10 @@ static int charging_mode_booting(void) {
if (f < 0)
return 0;
- if (1 != read(f, (void *)&cmb,1))
+ if (1 != read(f, (void *)&cmb,1)) {
+ close(f);
return 0;
+ }
close(f);
return ('1' == cmb);