Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19348f1c authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix media scanning in case readdir() returns type DT_UNKNOWN.

In that case, a stat() fallback was present in the code. The stat()
call, however, wasn't run on the file in question, but the containing
directory. Consequently, the file was treated as a directory, which
resulted in the scan being aborted due to opendir() failing. Example
logcat output:

D/MediaScanner( 2434): opendir
/system/media/audio/alarms/Alarm_Beep_01.ogg/ failed, errno: 20
E/MediaScanner( 2434): Error processing
'/system/media/audio/alarms/Alarm_Beep_01.ogg/' - skipping
D/MediaScanner( 2434): stat() failed for
/system/media/audio/alarms/Alarm_Beep_01.ogg/: Not a directory
D/MediaScanner( 2434): stat() failed for
/system/media/audio/alarms/Alarm_Beep_01.ogg/: Not a directory
D/MediaScanner( 2434): stat() failed for
/system/media/audio/alarms/Alarm_Beep_01.ogg/: Not a directory
[...]

Fix that issue by amending the file name to the buffer prior to calling
stat().
parent 5885a086
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment