]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ktest.pl: Allow dodie be recursive
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Apr 2018 21:16:39 +0000 (17:16 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 8 Apr 2018 00:18:26 +0000 (20:18 -0400)
If dodie cause a function that itself will call dodie, then be able to
handle that. This will allow dodie functions to call run_command, which
could possibly call dodie. If dodie is called again, simply ignore it.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 3400a23e6a41b1723f416d54bf5203c9cc641c22..ac6750bb5942671d5cd11b386bae5e2b50e78d87 100755 (executable)
@@ -1433,7 +1433,14 @@ sub do_not_reboot {
        ($test_type eq "config_bisect" && $opt{"CONFIG_BISECT_TYPE[$i]"} eq "build");
 }
 
+my $in_die = 0;
+
 sub dodie {
+
+    # avoid recusion
+    return if ($in_die);
+    $in_die = 1;
+
     doprint "CRITICAL FAILURE... ", @_, "\n";
 
     my $i = $iteration;