Fix #9477: Fix process exit code always being zero

- Replaced gExitCode occurences with EXIT_SUCCESS and EXIT_FAILURE
- Removed global declaration of gExitCode
This commit is contained in:
Lomash Gupta authored and Tulio Leao committed 2020-01-19 18:35:24 -03:00
1 parent 36840f3fe0
commit 0165261ac0
2 files changed
+14 -8

No files matched your search

+7 -4
View File
@@ -18,6 +18,7 @@ using namespace OpenRCT2;
*/
int main(int argc, const char** argv)
{
int32_t rc = EXIT_SUCCESS;
int runGame = cmdline_run(argv, argc);
core_init();
if (runGame == 1)
@@ -27,9 +28,11 @@ int main(int argc, const char** argv)
// Run OpenRCT2 with a plain context
auto context = CreateContext();
if((context->RunOpenRCT2(argc, argv)) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
rc = context->RunOpenRCT2(argc, argv);
}
return EXIT_FAILURE;
else if (runGame == -1)
{
rc = EXIT_FAILURE;
}
return rc;
}
+7 -4
View File
@@ -39,6 +39,7 @@ int main(int argc, const char** argv)
#endif
{
std::unique_ptr<IContext> context;
int32_t rc = EXIT_SUCCESS;
int runGame = cmdline_run(argv, argc);
core_init();
RegisterBitmapReader();
@@ -57,11 +58,13 @@ int main(int argc, const char** argv)
auto uiContext = to_shared(CreateUiContext(env));
context = CreateContext(env, audioContext, uiContext);
}
if (context->RunOpenRCT2(argc, argv) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
rc = context->RunOpenRCT2(argc, argv);
}
return EXIT_FAILURE;
else if (runGame == -1)
{
rc = EXIT_FAILURE;
}
return rc;
}
#ifdef __ANDROID__