From 75da8751b1e5a5a39f8743b44971224b0ab34c31 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 24 Apr 2004 12:25:10 +0000 Subject: Move duplicated IO::Handle preperations for GnuPG::Interface to Echolot::Tools::make_gpg_fds. --- Echolot/Stats.pm | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'Echolot/Stats.pm') diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm index cdb2372..31eb2b6 100644 --- a/Echolot/Stats.pm +++ b/Echolot/Stats.pm @@ -856,18 +856,7 @@ sub build_pgpring_type($$$$) { # only if we have a conf if ( defined Echolot::Globals::get()->{'storage'}->get_nick($addr) ) { - my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh ) - = ( IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - ); - my $handles = GnuPG::Handles->new ( - stdin => $stdin_fh, - stdout => $stdout_fh, - stderr => $stderr_fh, - status => $status_fh - ); + my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh, $handles ) = Echolot::Tools::make_gpg_fds(); my $pid = $GnuPG->wrap_call( commands => [ '--import' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --fast-list-mode --keyring}, $keyring, '--', '-' ], @@ -901,18 +890,7 @@ sub build_pgpring_type($$$$) { sub build_pgpring_export($$$$) { my ($GnuPG, $keyring, $file, $keyids) = @_; - my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh ) - = ( IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - ); - my $handles = GnuPG::Handles->new ( - stdin => $stdin_fh, - stdout => $stdout_fh, - stderr => $stderr_fh, - status => $status_fh - ); + my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh, $handles ) = Echolot::Tools::make_gpg_fds(); my $pid = $GnuPG->wrap_call( commands => [ '--export' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --keyring}, $keyring, @$keyids ], -- cgit v1.2.3