1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

Fix for simu running on VirtualBox mounted directories

This commit is contained in:
Bertrand Songis 2014-02-19 15:23:13 +01:00
parent 59af2e2719
commit 3340a18461

View file

@ -550,9 +550,11 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0);
#else
if (ent->d_type == simu::DT_UNKNOWN) {
fil->fattrib = 0;
struct stat buf;
lstat(ent->d_name, &buf);
fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0);
if (stat(ent->d_name, &buf) == 0) {
fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0);
}
}
else {
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);
strncpy(fil->fname, ent->d_name, 13-1);
strcpy(fil->lfname, ent->d_name);
// TRACE("f_readdir(): %s", fil->fname);
return FR_OK;
}