mirror of
https://github.com/libretro/RetroArch
synced 2025-02-15 09:40:11 +00:00
Refactors (#12057)
* lock_file_path here will never be empty * Simplify path_mkdir - final return value can become false, and sret variable can go
This commit is contained in:
parent
a4d1fb62dc
commit
dbe1061742
@ -1567,9 +1567,6 @@ bool core_info_set_core_lock(const char *core_path, bool lock)
|
||||
strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION,
|
||||
sizeof(lock_file_path));
|
||||
|
||||
if (string_is_empty(lock_file_path))
|
||||
return false;
|
||||
|
||||
/* Check whether lock file exists */
|
||||
lock_file_exists = path_is_valid(lock_file_path);
|
||||
|
||||
@ -1658,9 +1655,6 @@ bool core_info_get_core_lock(const char *core_path, bool validate_path)
|
||||
strlcat(lock_file_path, FILE_PATH_LOCK_EXTENSION,
|
||||
sizeof(lock_file_path));
|
||||
|
||||
if (string_is_empty(lock_file_path))
|
||||
return false;
|
||||
|
||||
/* Check whether lock file exists */
|
||||
is_locked = path_is_valid(lock_file_path);
|
||||
|
||||
|
@ -110,7 +110,6 @@ int32_t path_get_size(const char *path)
|
||||
**/
|
||||
bool path_mkdir(const char *dir)
|
||||
{
|
||||
bool sret = false;
|
||||
bool norecurse = false;
|
||||
char *basedir = NULL;
|
||||
|
||||
@ -132,15 +131,9 @@ bool path_mkdir(const char *dir)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (path_is_directory(basedir))
|
||||
if ( path_is_directory(basedir)
|
||||
|| path_mkdir(basedir))
|
||||
norecurse = true;
|
||||
else
|
||||
{
|
||||
sret = path_mkdir(basedir);
|
||||
|
||||
if (sret)
|
||||
norecurse = true;
|
||||
}
|
||||
|
||||
free(basedir);
|
||||
|
||||
@ -151,9 +144,8 @@ bool path_mkdir(const char *dir)
|
||||
/* Don't treat this as an error. */
|
||||
if (ret == -2 && path_is_directory(dir))
|
||||
return true;
|
||||
|
||||
return (ret == 0);
|
||||
else if (ret == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return sret;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user