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). --- script/lei | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/lei b/script/lei index a77ea880..1d90be0a 100755 --- a/script/lei +++ b/script/lei @@ -92,8 +92,8 @@ my $addr = pack_sockaddr_un($path); socket($sock, AF_UNIX, SOCK_SEQPACKET, 0) or die "socket: $!"; unless (connect($sock, $addr)) { # start the daemon if not started local $ENV{PERL5LIB} = join(':', @INC); - open(my $daemon, '-|', $^X, qw[-MPublicInbox::LEI - -E PublicInbox::LEI::lazy_start(@ARGV)], + open(my $daemon, '-|', $^X, $^W ? ('-w') : (), + qw[-MPublicInbox::LEI -e PublicInbox::LEI::lazy_start(@ARGV)], $path, $! + 0, $narg) or die "popen: $!"; while (<$daemon>) { warn $_ } # EOF when STDERR is redirected close($daemon) or warn <<""; -- cgit v1.2.3-24-ge0c7