From 48282c640eb4871f8fa07ea2ea06a2ef0e16535f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Nov 2019 10:14:09 +0000 Subject: t/common: set $0 when running script w/o fork We can localize changes to $0 so $0 is restored when the "script" sub is done. This will be helpful when we encounter a stuck/slow processes during our tests (hopefully never!) --- t/common.perl | 1 + 1 file changed, 1 insertion(+) diff --git a/t/common.perl b/t/common.perl index 0ff5de4a..288a0a19 100644 --- a/t/common.perl +++ b/t/common.perl @@ -171,6 +171,7 @@ sub run_script ($;$$) { local *STDERR = *STDERR; local %ENV = $env ? (%ENV, %$env) : %ENV; local %SIG = %SIG; + local $0 = join(' ', @$cmd); _prepare_redirects($fhref); _run_sub($sub, $key, \@argv); } -- cgit v1.2.3-24-ge0c7