| 390 | |
| 391 | |
| 392 | static int os_exit (lua_State *L) { |
| 393 | int status; |
| 394 | if (lua_isboolean(L, 1)) |
| 395 | status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE); |
| 396 | else |
| 397 | status = (int)luaL_optinteger(L, 1, EXIT_SUCCESS); |
| 398 | if (lua_toboolean(L, 2)) |
| 399 | lua_close(L); |
| 400 | if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */ |
| 401 | return 0; |
| 402 | } |
| 403 | |
| 404 | |
| 405 | static const luaL_Reg syslib[] = { |
nothing calls this directly
no test coverage detected