From 544856338d731e08a8ae00e694aa8cc2a45d141d Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 24 Apr 2004 14:55:49 +0000 Subject: Switch to a common readwrite_gpg() --- Echolot/Stats.pm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Echolot/Stats.pm') diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm index 31eb2b6..0d97783 100644 --- a/Echolot/Stats.pm +++ b/Echolot/Stats.pm @@ -861,13 +861,7 @@ sub build_pgpring_type($$$$) { commands => [ '--import' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --fast-list-mode --keyring}, $keyring, '--', '-' ], handles => $handles ); - print $stdin_fh $key{'key'}; - close($stdin_fh); - - my $stdout = join '', <$stdout_fh>; close($stdout_fh); - my $stderr = join '', <$stderr_fh>; close($stderr_fh); - my $status = join '', <$status_fh>; close($status_fh); - + my ($stdout, $stderr, $status) = readwrite_gpg($key{'key'}, $stdin_fh, $stdout_fh, $stderr_fh, $status_fh); waitpid $pid, 0; ($stdout eq '') or @@ -895,12 +889,7 @@ sub build_pgpring_export($$$$) { commands => [ '--export' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --keyring}, $keyring, @$keyids ], handles => $handles ); - close($stdin_fh); - - my $stdout = join '', <$stdout_fh>; close($stdout_fh); - my $stderr = join '', <$stderr_fh>; close($stderr_fh); - my $status = join '', <$status_fh>; close($status_fh); - + my ($stdout, $stderr, $status) = readwrite_gpg('', $stdin_fh, $stdout_fh, $stderr_fh, $status_fh); waitpid $pid, 0; open (F, ">$file") or -- cgit v1.2.3