init: Run restorecon_recursive asynchronously
restorecon_recursive may take a long time if there are a lot of files on
the volume. This can trigger a watchdog timeout in any process that
tries to set a property while it is running. Fix this by running
restorecon_recursive in its own process.
See https://jira.lineageos.org/browse/BUGBASH-555
Change-Id: I2ce26ff2b5bfc9a133ea42f4dbac50a3ac289c04
diff --git a/init/service.cpp b/init/service.cpp
index 1a6474b..b73ddfb 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -1085,6 +1085,8 @@
} else if (pid == -1) {
PLOG(ERROR) << "waitpid failed";
return false;
+ } else if (PropertyChildReap(pid)) {
+ return true;
}
Service* svc = FindServiceByPid(pid);