mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
ROM file check optimizations and cleanups
This commit is contained in:
@@ -405,21 +405,19 @@ path_append_filename(char *dest, const char *s1, const char *s2)
|
||||
int
|
||||
plat_dir_check(char *path)
|
||||
{
|
||||
struct stat dummy;
|
||||
if (stat(path, &dummy) < 0) {
|
||||
struct stat stats;
|
||||
if (stat(path, &stats) < 0)
|
||||
return 0;
|
||||
}
|
||||
return S_ISDIR(dummy.st_mode);
|
||||
return S_ISDIR(stats.st_mode);
|
||||
}
|
||||
|
||||
int
|
||||
plat_file_check(const char *path)
|
||||
{
|
||||
struct stat dummy;
|
||||
if (stat(path, &dummy) < 0) {
|
||||
struct stat stats;
|
||||
if (stat(path, &stats) < 0)
|
||||
return 0;
|
||||
}
|
||||
return !S_ISDIR(dummy.st_mode);
|
||||
return !S_ISDIR(stats.st_mode);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user