Improvements in the handling of signals

Added 'volatile' to 'l_signalT' variables plus some minor changes.
This commit is contained in:
Roberto Ierusalimschy
2020-05-22 11:40:34 -03:00
parent 9514abc2da
commit 17dbaa8639
5 changed files with 25 additions and 21 deletions

3
lua.c
View File

@@ -54,8 +54,9 @@ static void lstop (lua_State *L, lua_Debug *ar) {
** interpreter.
*/
static void laction (int i) {
int flag = LUA_MASKCALL | LUA_MASKRET | LUA_MASKLINE | LUA_MASKCOUNT;
signal(i, SIG_DFL); /* if another SIGINT happens, terminate process */
lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
lua_sethook(globalL, lstop, flag, 1);
}