Add a retry mechanism to execute blkid query SD card
Add a retry mechanism so that system tries to query the
blkid once more.
Issue: PRJ8901-1779
Issue: FP3-A11#183
Issue: FP3-A11#233
Change-Id: Ia8574f1a6aaae29d03821b8d74d0f68bcb3ea847
(cherry picked from commit ba2ee6e568d9311e3fad7bd273d22c70e271eba1)
(cherry picked from commit a91a4c39d32a3d5b638852225e8016fb7caeabae)
diff --git a/Utils.cpp b/Utils.cpp
index 494a0af..ac28a47 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -639,6 +639,15 @@
std::vector<std::string> output;
status_t res = ForkExecvp(cmd, &output, untrusted ? sBlkidUntrustedContext : sBlkidContext);
+
+ int count = 0;
+
+ while(res != OK && count < 5){
+ LOG(WARNING) << "blkid failed. retry " << path << " count = " << count;
+ res = ForkExecvp(cmd, &output, untrusted ? sBlkidUntrustedContext : sBlkidContext);
+ count++;
+ }
+
if (res != OK) {
LOG(WARNING) << "blkid failed to identify " << path;
return res;