Use sleep_for for fsck timeout
sleep may exit early due to interupts.
This ensures the full expected time elapses before timing out.
Bug: 258348748
Test: Mount removable storage with ~30K folders,
observe timeout in logs
Change-Id: I8092d4be43b85c9a53e8bb2658316159ab93bfc2
diff --git a/Utils.cpp b/Utils.cpp
index e8049ed..8214536 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -766,7 +766,7 @@
}
pid_t timer_pid = fork();
if (timer_pid == 0) {
- sleep(timeout.count());
+ std::this_thread::sleep_for(timeout);
_exit(ETIMEDOUT);
}
if (timer_pid == -1) {