[OTA] Retry stat-ing mapper device
See https://github.com/phhusson/treble_experimentations/issues/2289
This commit is contained in:
parent
56295977db
commit
39d801473b
@ -67,7 +67,10 @@ int main(int argc, char **argv) {
|
|||||||
printf("%s\n", blockDev.c_str());
|
printf("%s\n", blockDev.c_str());
|
||||||
|
|
||||||
struct stat sb;
|
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)) {
|
if(!S_ISBLK(sb.st_mode)) {
|
||||||
fprintf(stderr, "blockDev wasn't block dev\n");
|
fprintf(stderr, "blockDev wasn't block dev\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user