We should be able to rely on the return value of path_mkdir
instead of doing an additional negative path_is_directory check afterwards
This commit is contained in:
parent
146b4ccc50
commit
33e5a92867
6
paths.c
6
paths.c
|
@ -96,8 +96,7 @@ void path_set_redirect(void)
|
|||
* if everything fails revert to the original path. */
|
||||
if(!path_is_directory(new_savefile_dir))
|
||||
{
|
||||
path_mkdir(new_savefile_dir);
|
||||
if(!path_is_directory(new_savefile_dir))
|
||||
if (!path_mkdir(new_savefile_dir))
|
||||
{
|
||||
RARCH_LOG("%s %s\n",
|
||||
msg_hash_to_str(MSG_REVERTING_SAVEFILE_DIRECTORY_TO),
|
||||
|
@ -122,8 +121,7 @@ void path_set_redirect(void)
|
|||
* If everything fails, revert to the original path. */
|
||||
if(!path_is_directory(new_savestate_dir))
|
||||
{
|
||||
path_mkdir(new_savestate_dir);
|
||||
if(!path_is_directory(new_savestate_dir))
|
||||
if (!path_mkdir(new_savestate_dir))
|
||||
{
|
||||
RARCH_LOG("%s %s\n",
|
||||
msg_hash_to_str(MSG_REVERTING_SAVESTATE_DIRECTORY_TO),
|
||||
|
|
|
@ -4894,7 +4894,7 @@ bool rarch_write_debug_info(void)
|
|||
input_config_get_bind_string(descriptor,
|
||||
keybind, auto_bind, sizeof(descriptor));
|
||||
|
||||
if(!strstr(descriptor, "Auto") && auto_bind && !auto_bind->valid && auto_bind->joykey != 0xFFFF && !string_is_empty(auto_bind->joykey_label))
|
||||
if (!strstr(descriptor, "Auto") && auto_bind && !auto_bind->valid && auto_bind->joykey != 0xFFFF && !string_is_empty(auto_bind->joykey_label))
|
||||
rebind++;
|
||||
}
|
||||
}
|
||||
|
@ -5365,8 +5365,7 @@ void rarch_log_file_init(void)
|
|||
/* Create log directory, if required */
|
||||
if (!path_is_directory(settings->paths.log_dir))
|
||||
{
|
||||
path_mkdir(settings->paths.log_dir);
|
||||
if(!path_is_directory(settings->paths.log_dir))
|
||||
if (!path_mkdir(settings->paths.log_dir))
|
||||
{
|
||||
/* Re-enable console logging and output error message */
|
||||
retro_main_log_file_init(NULL, false);
|
||||
|
|
|
@ -353,9 +353,7 @@ runtime_log_t *runtime_log_init(const char *content_path, const char *core_path,
|
|||
/* Create directory, if required */
|
||||
if (!path_is_directory(log_file_dir))
|
||||
{
|
||||
path_mkdir(log_file_dir);
|
||||
|
||||
if(!path_is_directory(log_file_dir))
|
||||
if (!path_mkdir(log_file_dir))
|
||||
{
|
||||
RARCH_ERR("[runtime] failed to create directory for runtime log: %s.\n", log_file_dir);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue