1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-15 00:40:06 +00:00
* 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:
Autechre 2021-02-21 11:09:11 +01:00 committed by GitHub
parent a4d1fb62dc
commit dbe1061742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 19 deletions
core_info.c
libretro-common/file

@ -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;
}