Add timeout protection while SDCard is checking for data
When fsck_msdos detects the problematic data, it will take a lot
of time. And it will lock the UI thread and cause the watchdog to
be triggered repeatedly.
To fix, Add a timeout mechanism to avoid locking the UI thread.
Issue: PRJ8901-1771
Issue: FP3-A11#183
Issue: FP3-A11#233
Change-Id: I7fceac9b096d033eac4827debb2bd4045cf6faf8
(cherry picked from commit 1a11ad62787c33e6f0ef5bd60d79d08034faef20)
(cherry picked from commit b80a4b6d5c3d58ceccdd3f7efc35e6f607e6a2b7)
diff --git a/fs/Vfat.cpp b/fs/Vfat.cpp
index 09d4c1a..b597b17 100644
--- a/fs/Vfat.cpp
+++ b/fs/Vfat.cpp
@@ -68,7 +68,8 @@
cmd.push_back(source);
// Fat devices are currently always untrusted
- rc = ForkExecvp(cmd, nullptr, sFsckUntrustedContext);
+ //rc = ForkExecvp(cmd, nullptr, sFsckUntrustedContext);
+ rc = ForkExecvpTimeout(cmd, nullptr, sFsckUntrustedContext);
if (rc < 0) {
LOG(ERROR) << "Filesystem check failed due to logwrap error";