You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Support for file not found in ConfigFile::Load and handle a few specific cases
EditorSettings::set_project_metadata: creates project_metadata.cfg if it doesn't exist EditorPlugin::get_config: removed (not used) Fixes #31444
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(UNIX_ENABLED)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -112,8 +114,15 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
|
||||
f = fopen(path.utf8().get_data(), mode_string);
|
||||
|
||||
if (f == NULL) {
|
||||
last_error = ERR_FILE_CANT_OPEN;
|
||||
return ERR_FILE_CANT_OPEN;
|
||||
switch (errno) {
|
||||
case ENOENT: {
|
||||
last_error = ERR_FILE_NOT_FOUND;
|
||||
} break;
|
||||
default: {
|
||||
last_error = ERR_FILE_CANT_OPEN;
|
||||
} break;
|
||||
}
|
||||
return last_error;
|
||||
} else {
|
||||
last_error = OK;
|
||||
flags = p_mode_flags;
|
||||
|
||||
Reference in New Issue
Block a user