]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib: interrupt_hook: send interrupt to children
authorTobias Ulmer <tu@emlix.com>
Fri, 15 Feb 2019 10:38:28 +0000 (11:38 +0100)
committerTobias Ulmer <tu@emlix.com>
Fri, 15 Feb 2019 10:59:58 +0000 (11:59 +0100)
note interrupt_hook() no longer terminates e2factory

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua
generic/le2lib.c

index 2ea35e8d44022af4f92d88f475df0509151f899a..44a50f15f3028ed68acdc64ea72aaf449a56b3aa 100644 (file)
@@ -519,13 +519,10 @@ function e2lib.execvp(filenm, argv)
 end
 
 --- Interrupt handling.
--- signal_install() sets up signal handlers that call back into this function.
+-- le2lib.signal_install() installs a handler calling back into this function.
 function e2lib.interrupt_hook()
-    local sigstr, signum = e2lib.signal_received()
     trace.install() -- reinstall the trace hook.
-    e2lib.logf(4, "interrupt_hook() pid=%d, signal=%d, sigstr=%s",
-        e2lib.getpid(), signum, sigstr)
-    e2lib.abort(string.format("*** interrupted by user (%s) ***", sigstr))
+    children_send_sigint()
 end
 
 --- Make sure the environment variables inside the globals table are
index 67a4ff60217882bd08df1b70c6d0d848b5865314..28b5cef0e42799468e1702097ba385bce8e846b7 100644 (file)
@@ -796,10 +796,6 @@ lua_signal_handler(lua_State *L, lua_Debug *ar)
        lua_getfield(L, -1, "interrupt_hook");
        lua_remove(L, -2); /* remove e2lib, balance stack */
        lua_call(L, 0, 0);
-
-       /* not reached under normal circumstances */
-       fprintf(stderr, "e2: calling interrupt_hook failed, terminating\n");
-       exit(1);
 }
 
 /* Lua context for signal handler */