commit:     d00387e421e541bad7e3c16e2a7c67bc3c0a1cb7
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  2 17:33:03 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jan  2 17:33:03 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d00387e4

gen_funcs.sh: gen_die(): Prevent recursion

Closes: https://bugs.gentoo.org/704546
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_funcs.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 87e4b3a..1f574ad 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -407,6 +407,14 @@ gen_die() {
                # We died in a subshell! Let's trigger trap function...
                kill -s SIGTERM ${GK_MASTER_PID}
        else
+               if [ -z "${GK_DIED_IN}" ]
+               then
+                       GK_DIED_IN="$(get_useful_function_stack)"
+               else
+                       # We are already dying
+                       exit 1
+               fi
+
                # Don't trust $LOGFILE before determine_real_args() was called
                if [ -n "${CMD_LOGFILE}" -a -s "${LOGFILE}" ]
                then

Reply via email to