From b231d91f42d791becf7b6861e723833d71e73237 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 1 Oct 2023 09:54:27 +0000 Subject: treewide: enable warnings in all exec-ed processes While forked processes inherit from the parent, exec-ed processes need the `-w' flag passed to them. To determine whether or not we should pass them, we must check the `$^W' global perlvar, first. We'll also favor `perl -e' over `perl -E' in places where we don't rely on the latest features, since `-E' incurs slightly more startup time overhead from loading feature.pm (while `perl -Mv5.12' does not). --- lib/PublicInbox/LeiRediff.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiRediff.pm') diff --git a/lib/PublicInbox/LeiRediff.pm b/lib/PublicInbox/LeiRediff.pm index 6cc6131b..a886931c 100644 --- a/lib/PublicInbox/LeiRediff.pm +++ b/lib/PublicInbox/LeiRediff.pm @@ -140,7 +140,7 @@ EOM sub wait_requote { # OnDestroy callback my ($lei, $pid, $old_1) = @_; - $lei->{1} = $old_1; # closes stdin of `perl -pE 's/^/> /'` + $lei->{1} = $old_1; # closes stdin of `perl -pe 's/^/> /'` waitpid($pid, 0) == $pid or die "BUG(?) waitpid: \$!=$! \$?=$?"; $lei->child_error($?) if $?; } @@ -150,7 +150,7 @@ sub requote ($$) { my $old_1 = $lei->{1}; my $opt = { 1 => $old_1, 2 => $lei->{2} }; # $^X (perl) is overkill, but maybe there's a weird system w/o sed - my ($w, $pid) = popen_wr([$^X, '-pE', "s/^/$pfx/"], $lei->{env}, $opt); + my ($w, $pid) = popen_wr([$^X, '-pe', "s/^/$pfx/"], $lei->{env}, $opt); $w->autoflush(1); binmode $w, ':utf8'; # incompatible with ProcessPipe due to syswrite $lei->{1} = $w; -- cgit v1.2.3-24-ge0c7