From b3fb546c9bf124badecfa85a460f64c0c763f895 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 9 Oct 2013 08:47:57 +0100 Subject: wip, compile fixes --- dgit | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index 6a3f7b7..08ecca6 100755 --- a/dgit +++ b/dgit @@ -28,7 +28,6 @@ use File::Basename; use Dpkg::Version; use POSIX; use IPC::Open2; -use File::Temp; our $our_version = 'UNRELEASED'; ###substituted### @@ -172,8 +171,8 @@ sub badproto ($$) { fail "protocol violation; $m not expected"; } -sub protocol_expect ($&) { - my ($fh, $match) = @_; +sub protocol_expect (&$) { + my ($match, $fh) = @_; local $_; $_ = <$fh>; defined && chomp or badproto $fh, "eof"; @@ -209,7 +208,7 @@ sub protocol_receive_file ($$) { my ($fh, $ourfn) = @_; open PF, ">", $ourfn or die "$ourfn: $!"; for (;;) { - protocol_expect \*STDIN, { m/^data-block (.*})$|data-end$/ }; + protocol_expect { m/^data-block (.*})$|data-end$/ } \*STDIN; length $1 or last; my $d = protocol_read_bytes \*STDIN, $1; print PF $d or die $!; @@ -240,14 +239,14 @@ sub responder_receive_files ($@) { foreach my $fn (@ourfns) { protocol_receive_file \*STDIN, $fn; } - protocol_expect \*STDIN, { m/^files-end$/ }; + protocol_expect { m/^files-end$/ } \*STDIN; } #---------- remote protocol support, initiator ---------- sub initiator_expect (&) { my ($match) = @_; - protocol_expect \*RO, &$match; + protocol_expect { &$match } \*RO; } #---------- end remote code ---------- -- cgit v1.2.3