summaryrefslogtreecommitdiff
path: root/Echolot/Pinger
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-04-24 14:55:49 +0000
committerPeter Palfrader <peter@palfrader.org>2004-04-24 14:55:49 +0000
commit544856338d731e08a8ae00e694aa8cc2a45d141d (patch)
treeaebceeec67e955bc4fca215b5f2b3152e032d1b8 /Echolot/Pinger
parent75da8751b1e5a5a39f8743b44971224b0ab34c31 (diff)
Switch to a common readwrite_gpg()
Diffstat (limited to 'Echolot/Pinger')
-rw-r--r--Echolot/Pinger/CPunk.pm15
1 files changed, 2 insertions, 13 deletions
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