[OTA] Retry stat-ing mapper device

See https://github.com/phhusson/treble_experimentations/issues/2289
This commit is contained in:
Pierre-Hugues Husson 2022-04-24 08:03:48 -04:00
parent 56295977db
commit 39d801473b
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ int main(int argc, char **argv) {
printf("%s\n", blockDev.c_str());
struct stat sb;
stat(blockDev.c_str(), &sb);
for(int i=0; i<10; i++) {
if(!stat(blockDev.c_str(), &sb)) break;
sleep(1);
}
if(!S_ISBLK(sb.st_mode)) {
fprintf(stderr, "blockDev wasn't block dev\n");