summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-09-16 14:31:23 -0700
committerRom Lemarchand <romlem@google.com>2014-09-16 22:14:46 +0000
commit40af09297f9d60a3cfd4a186ff294cef6255a9df (patch)
tree155482386b457171a7680be297dbf18e7a62a19f
parent81b857f3a21f3ae96a5ec72e54982fe30278049f (diff)
downloadsystem_core-40af09297f9d60a3cfd4a186ff294cef6255a9df.zip
system_core-40af09297f9d60a3cfd4a186ff294cef6255a9df.tar.gz
system_core-40af09297f9d60a3cfd4a186ff294cef6255a9df.tar.bz2
Fix charger mode on first boot of force encrypt devices
waitpid breaks whenever child status signals. Need to loop, continuing on errno EINTR Bug: 17515976 Change-Id: Ibb29056a38b3c90dc7904de8c6aedb5a362e511d
-rw-r--r--init/builtins.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/init/builtins.c b/init/builtins.c
index de83c93..8dbaab7 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -515,7 +515,12 @@ int do_mount_all(int nargs, char **args)
pid = fork();
if (pid > 0) {
/* Parent. Wait for the child to return */
- waitpid(pid, &status, 0);
+ int wp_ret = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0));
+ if (wp_ret < 0) {
+ /* Unexpected error code. We will continue anyway. */
+ NOTICE("waitpid failed rc=%d, errno=%d\n", wp_ret, errno);
+ }
+
if (WIFEXITED(status)) {
ret = WEXITSTATUS(status);
} else {