From: Adrian M. Enache Date: Tue, 22 Apr 2003 02:54:05 +0000 (+0300) Subject: A variant of X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4a9c615f87561d7a5c6e4e7107930cb03cbcd67;p=p5sagit%2Fp5-mst-13.2.git A variant of Subject: Re: 0 is not perl (was Re: Report /export/home/nwc10/Gripping-Smoke/Smoke) Message-ID: <20030421235405.GA1162@ratsnest.hole> to quench the black smoke from the BSD builds. p4raw-id: //depot/perl@19445 --- diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 8e5b9b8..fc7febc 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -1170,14 +1170,16 @@ in these dirs: my $stderr_duped = 0; local *STDERR_COPY; - if( open(STDERR_COPY, '>&STDERR') ) { - $stderr_duped = 1; - } - else { - warn <&STDERR') ) { + $stderr_duped = 1; + } + else { + warn <maybe_command($abs); print "Executing $abs\n" if ($trace >= 2); - # To avoid using the unportable 2>&1 to supress STDERR, - # we close it before running the command. - close STDERR if $stderr_duped; my $version_check = qq{$abs -e "require $ver; print qq{VER_OK\n}"}; - $val = `$version_check`; - open STDERR, '>&STDERR_COPY' if $stderr_duped; + # To avoid using the unportable 2>&1 to suppress STDERR, + # we close it before running the command. + # However, thanks to a thread library bug in many BSDs + # ( http://www.freebsd.org/cgi/query-pr.cgi?pr=51535 ) + # we cannot use the fancier more portable way in here + # but instead need to use the traditional 2>&1 construct. + if ($^O =~ /^(?:free|net|open)bsd|bsdos$/) { + $val = `$version_check 2>&1`; + } else { + close STDERR if $stderr_duped; + $val = `$version_check`; + open STDERR, '>&STDERR_COPY' if $stderr_duped; + } print STDERR "Perl version check failed: '$version_check'\n" unless defined $val;