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/Pinger/CPunk.pm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Echolot/Pinger') diff --git a/Echolot/Pinger/CPunk.pm b/Echolot/Pinger/CPunk.pm index 1aa8f07..09145d2 100644 --- a/Echolot/Pinger/CPunk.pm +++ b/Echolot/Pinger/CPunk.pm @@ -44,13 +44,7 @@ sub encrypt_to($$$$) { commands => [ '--import' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --fast-list-mode --keyring}, $keyring, '--', '-' ], handles => $handles ); - print $stdin_fh $keys->{$recipient}->{'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($keys->{$recipient}->{'key'}, $stdin_fh, $stdout_fh, $stderr_fh, $status_fh); waitpid $pid, 0; ($stdout eq '') or @@ -102,12 +96,7 @@ sub encrypt_to($$$$) { $pid = $GnuPG->encrypt( command_args => $command_args, handles => $handles ); - close($stdin_fh); - - $stdout = join '', <$stdout_fh>; close($stdout_fh); - $stderr = join '', <$stderr_fh>; close($stderr_fh); - $status = join '', <$status_fh>; close($status_fh); - + my ($stdout, $stderr, $status) = readwrite_gpg('', $stdin_fh, $stdout_fh, $stderr_fh, $status_fh); waitpid $pid, 0; #($stderr eq '') or -- cgit v1.2.3