From a601336ca421f8d32820174a0389a042a3a0238b Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Mon, 3 Jun 2019 19:30:32 +0200 Subject: [PATCH] be more responsive and frequently check for signals Signed-off-by: Tobias Ulmer --- generic/e2lib.lua | 2 +- local/licence.lua | 4 ++++ local/projenv.lua | 4 ++++ local/result.lua | 4 ++++ local/source.lua | 5 +++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 9b46773..205980c 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1892,7 +1892,7 @@ function e2lib.callcmd(argv, fdctv, workdir, envdict, nowait, pty) local sync_pipes if e2lib.signal_received() ~= "" then - return false, err.new("signal received, shutting down e2factory") + return false, err.new("shutting down e2factory [fork]") end rc, re = fd_parent_setup(fdctv, argv) diff --git a/local/licence.lua b/local/licence.lua index 8c3224f..25c7853 100644 --- a/local/licence.lua +++ b/local/licence.lua @@ -158,6 +158,10 @@ function licence.load_licence_config() for name,l in pairs(ltable) do local lerr = err.new("error in licence %q", name) + if e2lib.signal_received() ~= "" then + return false, err.new("shutting down e2factory [lic]") + end + rc, re = e2lib.vrfy_dict_exp_keys(l, "licence", { "server", "files" }) if not rc then diff --git a/local/projenv.lua b/local/projenv.lua index 9874537..fd0ad6c 100644 --- a/local/projenv.lua +++ b/local/projenv.lua @@ -75,6 +75,10 @@ local function _load_env_config(file) local rc, re local merge_error = false + if e2lib.signal_received() ~= "" then + return false, err.new("shutting down e2factory [penv]") + end + local function mergeenv(data) -- upvalues: file, _load_env_config(), merge_error local rc, re diff --git a/local/result.lua b/local/result.lua index e8444e8..60fe0d7 100644 --- a/local/result.lua +++ b/local/result.lua @@ -692,6 +692,10 @@ function result.load_result_configs() for _,cfg in ipairs(configs) do local rawres, obj + if e2lib.signal_received() ~= "" then + return false, err.new("shutting down e2factory [res]") + end + rawres, re = load_rawres(cfg) if not rawres then return false, re diff --git a/local/source.lua b/local/source.lua index ac43939..ad51c10 100644 --- a/local/source.lua +++ b/local/source.lua @@ -246,6 +246,11 @@ function source.load_source_configs() end for _,cfg in ipairs(configs) do + + if e2lib.signal_received() ~= "" then + return false, err.new("shutting down e2factory [src]") + end + rc, re = e2tool.verify_src_res_pathname_valid_chars(cfg) if not rc then e:append("invalid source file name: %s", cfg) -- 2.39.5