summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/MM_Unix.pm
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-04-22 05:54:05 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2003-05-08 05:21:44 +0000
commitc4a9c615f87561d7a5c6e4e7107930cb03cbcd67 (patch)
tree79929a0ba0f6df1c3052ed2c4a1c22e37c608077 /lib/ExtUtils/MM_Unix.pm
parentb8d5f52139b667ea3276273b5665157310d1a461 (diff)
downloadperl-c4a9c615f87561d7a5c6e4e7107930cb03cbcd67.tar.gz
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
Diffstat (limited to 'lib/ExtUtils/MM_Unix.pm')
-rw-r--r--lib/ExtUtils/MM_Unix.pm30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 8e5b9b802a..fc7febcaa6 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 <<WARNING;
+ unless ($^O =~ /^(?:free|net|open)bsd|bsdos$/) { # Search for '51535'.
+ if( open(STDERR_COPY, '>&STDERR') ) {
+ $stderr_duped = 1;
+ }
+ else {
+ warn <<WARNING;
find_perl() can't dup STDERR: $!
You might see some garbage while we search for Perl
WARNING
+ }
}
foreach $name (@$names){
@@ -1196,12 +1198,20 @@ WARNING
next unless $self->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;