summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-03 13:32:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-03 13:32:38 +0000
commit0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460 (patch)
tree50d3a95f49c748e313e26a268796631b1b3688d5
parentaec1462bd0798bae8a3761f2e2a89c64bac04a17 (diff)
downloaddrakx-0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460.tar
drakx-0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460.tar.gz
drakx-0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460.tar.bz2
drakx-0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460.tar.xz
drakx-0f0c31cf5c3e5ddba06c1d67aeb9b2a43506a460.zip
(find_exports): use run_program::raw + stdout
-rw-r--r--perl-install/network/nfs.pm14
1 files changed, 5 insertions, 9 deletions
diff --git a/perl-install/network/nfs.pm b/perl-install/network/nfs.pm
index bd153259f..ab8bcfcd7 100644
--- a/perl-install/network/nfs.pm
+++ b/perl-install/network/nfs.pm
@@ -33,15 +33,14 @@ sub check {
}
sub find_servers {
- local *F;
- my $pid = open F, "rpcinfo-flushed -b mountd 2 |";
+ my $pid = open(my $F, "rpcinfo-flushed -b mountd 2 |");
$SIG{ALRM} = sub { kill(15, $pid) };
alarm 1;
my $domain = chomp_(`domainname`);
my @servers;
local $_;
- while (<F>) {
+ while (<$F>) {
chomp;
my ($ip, $name) = /(\S+)\s+(\S+)/ or log::l("bad line in rpcinfo output"), next;
$name =~ s/\Q.$domain//;
@@ -54,13 +53,10 @@ sub find_servers {
sub find_exports {
my ($class, $server) = @_;
- local *F;
- my $s = $server->{ip} || $server->{name};
- my $pid = open F, "showmount -e $s |";
- $SIG{ALRM} = sub { kill(15, $pid) };
- alarm 5;
+ my @l;
+ run_program::raw({ timeout => 1 }, "showmount", '>', \@l, "-e", $server->{ip} || $server->{name});
- my (undef, @l) = <F>;
+ shift @l; #- drop first line
map { /(\S+)\s*(\S+)/; { name => $1, comment => $2, server => $server } } @l;
}