MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / os_exit

Function os_exit

third-party/lua-5.2.4/src/loslib.c:287–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286
287static int os_exit (lua_State *L) {
288 int status;
289 if (lua_isboolean(L, 1))
290 status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE);
291 else
292 status = luaL_optint(L, 1, EXIT_SUCCESS);
293 if (lua_toboolean(L, 2))
294 lua_close(L);
295 if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */
296 return 0;
297}
298
299
300static const luaL_Reg syslib[] = {

Callers

nothing calls this directly

Calls 2

lua_tobooleanFunction · 0.70
lua_closeFunction · 0.70

Tested by

no test coverage detected