diff options
author | Max Horn | 2011-05-23 19:20:56 +0200 |
---|---|---|
committer | Max Horn | 2011-05-23 19:39:26 +0200 |
commit | 6c5f50c246062bcb50a20efe7951be7e23449ca0 (patch) | |
tree | 9d8bb0bbb869fac5ba1387d90894fee50c8325ea /engines/sword25/util/lua | |
parent | 20cad6e8b6fe9ae843245697e872256c4ca1e545 (diff) | |
download | scummvm-rg350-6c5f50c246062bcb50a20efe7951be7e23449ca0.tar.gz scummvm-rg350-6c5f50c246062bcb50a20efe7951be7e23449ca0.tar.bz2 scummvm-rg350-6c5f50c246062bcb50a20efe7951be7e23449ca0.zip |
COMMON: Add exit() to list of forbidden symbols
Diffstat (limited to 'engines/sword25/util/lua')
-rw-r--r-- | engines/sword25/util/lua/ldo.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/util/lua/loslib.cpp | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/engines/sword25/util/lua/ldo.cpp b/engines/sword25/util/lua/ldo.cpp index b03992385a..b699c5d8a7 100644 --- a/engines/sword25/util/lua/ldo.cpp +++ b/engines/sword25/util/lua/ldo.cpp @@ -13,6 +13,8 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_setjmp #define FORBIDDEN_SYMBOL_EXCEPTION_longjmp +#include "common/textconsole.h" + #include <setjmp.h> #include <stdlib.h> #include <string.h> @@ -116,7 +118,7 @@ void luaD_throw (lua_State *L, int errcode) { lua_unlock(L); G(L)->panic(L); } - exit(EXIT_FAILURE); + error("luaD_throw failure"); } } diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp index c46aea59bd..b61f8c65e1 100644 --- a/engines/sword25/util/lua/loslib.cpp +++ b/engines/sword25/util/lua/loslib.cpp @@ -18,6 +18,7 @@ #include "lualib.h" #include "common/system.h" +#include "common/textconsole.h" static int os_execute (lua_State *L) { @@ -214,10 +215,9 @@ static int os_exit (lua_State *L) { // Using OSystem::quit() isn't really a great idea, either. // We really would prefer to let the main run loop exit, so that // our main() can perform cleanup. - g_system->quit(); - // leave the exit call in there for now, in case some of our - // OSystem::quit applications are incorrect... *sigh* - exit(luaL_optint(L, 1, EXIT_SUCCESS)); + if (0 == luaL_optint(L, 1, EXIT_SUCCESS)) + g_system->quit(); + error("LUA os_exit invokes with non-zero exit value"); } static const luaL_Reg syslib[] = { |