am 48fb175d: am 40af0929: Fix charger mode on first boot of force encrypt devices
* commit '48fb175d22a80ac39db803a8bb78df876971c64b':
Fix charger mode on first boot of force encrypt devices
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 @@
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 {