Any/OS/POSIX/DPipe.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran n/a Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 63 CC 1 SCAR 6.9
CC
1
Cov
0%
_upgrade_fh_to_dpipe
2.0
_close_fhs
2.0
syswrite
2.0
CRAP 2.0
1 package Net::SSH::Any::OS::POSIX::DPipe;
2  
3 use strict;
4 use warnings;
5  
6 use Net::SSH::Any::Constants qw(SSHA_CHANNEL_ERROR);
7 use Net::SSH::Any::Util qw($debug _debug _debug_hexdump);
8  
9 require Net::SSH::Any::OS::_Base::DPipe;
10 our @ISA = qw(Net::SSH::Any::OS::_Base::DPipe);
11  
12 sub _upgrade_fh_to_dpipe {
13 my ($class, $dpipe, $any, $proc) = @_;
14 $class->SUPER::_upgrade_fh_to_dpipe($dpipe, $any, $proc);
15 $dpipe->autoflush(1);
16 $dpipe;
17 }
18  
19 sub _close_fhs {
20 my $dpipe = shift;
21 close $dpipe and return 1;
22 $dpipe->_any->_set_error(SSHA_CHANNEL_ERROR, "Unable to close socket: $!");
23 undef
24 }
25  
26 sub syswrite {
27 my $dpipe = shift;
28 my (undef, $len, $offset) = @_;
29 $len ||= "<undef>";
30 $offset ||= "<undef>";
31 $debug and $debug & 8192 and
32 _debug_hexdump("$dpipe->syswrite(..., $len, $offset)", $_[0]);
33 $dpipe->SUPER::syswrite(@_);
34 }
35  
36 sub send_eof {
37 my $dpipe = shift;
38 shutdown $dpipe, 1;
39 }
40  
41 1;