diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-10-09 08:47:57 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-10-09 08:47:57 +0100 |
commit | b3fb546c9bf124badecfa85a460f64c0c763f895 (patch) | |
tree | ee13064b1fb85897c1b162dede981225c80b84eb | |
parent | 1a0af5412f153e24462cdb1ec41a378975376d0c (diff) |
wip, compile fixes
-rwxr-xr-x | dgit | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 ---------- |