diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 9a1156f6b..bc96c17a1 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -649,6 +650,20 @@ _remount: fprintf(f, "/sbin/hotplug\n"); fclose(f); } +#else + /* mounting is asynchronous via mdev, so wait for the directory to appear */ + for (int i = 0; i < 20; i++) { + struct statfs s; + if (::statfs(dst, &s) == 0) { + if (s.f_type == 0xEF53) /* EXT3_SUPER_MAGIC */ + break; + if (s.f_type == 0x52654973) /* REISERFS_SUPER_MAGIC */ + break; + } + if (i == 0) + printf("CHDDFmtExec: waiting for %s to be mounted\n", dst); + sleep(1); + } #endif if(!res) {