mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
Fix for simu running on VirtualBox mounted directories
This commit is contained in:
parent
59af2e2719
commit
3340a18461
1 changed files with 5 additions and 2 deletions
|
@ -550,9 +550,11 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
|
||||||
fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0);
|
fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0);
|
||||||
#else
|
#else
|
||||||
if (ent->d_type == simu::DT_UNKNOWN) {
|
if (ent->d_type == simu::DT_UNKNOWN) {
|
||||||
|
fil->fattrib = 0;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
lstat(ent->d_name, &buf);
|
if (stat(ent->d_name, &buf) == 0) {
|
||||||
fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0);
|
fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fil->fattrib = (ent->d_type == simu::DT_DIR ? AM_DIR : 0);
|
fil->fattrib = (ent->d_type == simu::DT_DIR ? AM_DIR : 0);
|
||||||
|
@ -563,6 +565,7 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
|
||||||
memset(fil->lfname, 0, SD_SCREEN_FILE_LENGTH);
|
memset(fil->lfname, 0, SD_SCREEN_FILE_LENGTH);
|
||||||
strncpy(fil->fname, ent->d_name, 13-1);
|
strncpy(fil->fname, ent->d_name, 13-1);
|
||||||
strcpy(fil->lfname, ent->d_name);
|
strcpy(fil->lfname, ent->d_name);
|
||||||
|
// TRACE("f_readdir(): %s", fil->fname);
|
||||||
return FR_OK;
|
return FR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue