mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Let ctrl-c interrupt lua server pages in repl mode
This commit is contained in:
parent
178a6da4b9
commit
54e6f564c1
3 changed files with 32 additions and 3 deletions
8
third_party/lua/lrepl.c
vendored
8
third_party/lua/lrepl.c
vendored
|
@ -380,6 +380,13 @@ int lua_loadline (lua_State *L) {
|
|||
}
|
||||
|
||||
|
||||
void lua_sigint (lua_State *L, int sig) {
|
||||
int flag = LUA_MASKCALL | LUA_MASKRET | LUA_MASKLINE | LUA_MASKCOUNT;
|
||||
lua_sethook(L, lstop, flag, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Function to be called at a C signal. Because a C signal cannot
|
||||
** just change a Lua state (as there is no proper synchronization),
|
||||
|
@ -387,6 +394,7 @@ int lua_loadline (lua_State *L) {
|
|||
** interpreter.
|
||||
*/
|
||||
static void laction (int i) {
|
||||
lua_sigint(globalL, i);
|
||||
int flag = LUA_MASKCALL | LUA_MASKRET | LUA_MASKLINE | LUA_MASKCOUNT;
|
||||
lua_sethook(globalL, lstop, flag, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue