| 371 | |
| 372 | |
| 373 | static int os_exit (lua_State *L) { |
| 374 | int status; |
| 375 | if (lua_isboolean(L, 1)) |
| 376 | status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE); |
| 377 | else |
| 378 | status = (int)luaL_optinteger(L, 1, EXIT_SUCCESS); |
| 379 | if (lua_toboolean(L, 2)) |
| 380 | lua_close(L); |
| 381 | if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */ |
| 382 | return 0; |
| 383 | } |
| 384 | |
| 385 | |
| 386 | static const luaL_Reg syslib[] = { |
nothing calls this directly
no test coverage detected