mirror of
https://github.com/godotengine/godot.git
synced 2024-11-15 00:23:27 +00:00
Linux: Check return value of chdir on cleanup
Some compilers trigger a warning for it if we do not bother checking the return value. Fixes #29849.
This commit is contained in:
parent
1d93b4abef
commit
40db7b85af
@ -55,8 +55,11 @@ int main(int argc, char *argv[]) {
|
||||
os.run(); // it is actually the OS that decides how to run
|
||||
Main::cleanup();
|
||||
|
||||
if (ret)
|
||||
chdir(cwd);
|
||||
if (ret) { // Previous getcwd was successful
|
||||
if (chdir(cwd) != 0) {
|
||||
ERR_PRINT("Couldn't return to previous working directory.");
|
||||
}
|
||||
}
|
||||
free(cwd);
|
||||
|
||||
return os.get_exit_code();
|
||||
|
Loading…
Reference in New Issue
Block a user