21a22 > use constant FIONBIO => 0x8004667e; 24a26,27 > use Win32; > use Win32API::File; qw( :ALL ); 108c111,117 < my $user_config = delete $arg{user_config} || "$ENV{HOME}/.ssh/config"; --- > my $home; > if ($^O =~ /Win32/i) { > $home = $ENV{HOMEDRIVE}.$ENV{HOMEPATH} || Win32::GetFolderPath( "Win32::CSIDL_PERSONAL" ); > } else { > $home = $ENV{HOME} || (getpwuid($>))[7]; > } > my $user_config = delete $arg{user_config} || "$home/.ssh/config"; 213,215c222,228 < defined($sock->blocking(0)) < or die "Can't set socket non-blocking: $!"; < --- > if ($^O =~ /Win32/i) { > my $nonblocking = "\x00\x00\x00\x01"; # pack("L",1) works too > my $PtrToLong = unpack("I",pack('P',$nonblocking)); # get address to the variable contents, not it's reference structure > ioctl($sock, FIONBIO,$PtrToLong ) or die "Can't set socket non-blocking: $!"; > } else { > defined($sock->blocking(0)) or die "Can't set socket non-blocking: $!"; > }