| 285 | |
| 286 | |
| 287 | static 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 | |
| 300 | static const luaL_Reg syslib[] = { |
nothing calls this directly
no test coverage detected