From 34fb312bacec318526b169c74f33c68bf3495ce8 Mon Sep 17 00:00:00 2001 From: damien Date: Tue, 4 Dec 2001 15:42:47 +0000 Subject: corrected pipe reading --- perl-install/network/tools.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 33c4f300c..3a11daeb4 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -124,11 +124,11 @@ sub connected_bg { *F = *$kid_pipe; fcntl(F, c::F_SETFL(), c::O_NONBLOCK()) or die "can't fcntl F_SETFL: $!"; my $a; - if ($a = ) { + if (defined($a = )) { close($kid_pipe) || warn "kid exited $?"; undef $kid_pipe; - $a eq '1' and $$ref = 1; - $a eq '0' and $$ref = 0; + print STDERR "debug - hostname result : $a\n" + $$ref = $a; } } else { $kid_pipe = connected2() } 1; @@ -140,7 +140,6 @@ sub connected2 { return \*KID_TO_READ; } else { # child my $a = gethostbyname("mandrakesoft.com") ? 1 : 0; - print "$a"; c::_exit(0); } } -- cgit v1.2.1