[libanyevent-handle-udp-perl] 34/60: Made it work with old perl+old Socket.pm
Jonas Smedegaard
js at alioth.debian.org
Mon Sep 30 10:05:42 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libanyevent-handle-udp-perl.
commit f8eb2f55d1c718260ad39e3796502327e8fb9e4f
Author: Leon Timmermans <fawaka at gmail.com>
Date: Mon Dec 10 23:51:11 2012 +0100
Made it work with old perl+old Socket.pm
---
Changes | 1 +
lib/AnyEvent/Handle/UDP.pm | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Changes b/Changes
index 041cbb5..ca85cbe 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for AnyEvent-Handle-UDP
{{$NEXT}}
+ Made it work with old perl+old Socket.pm
0.037 2012-11-15 00:29:31 Europe/Amsterdam
Handle absence of IPv6 better (hopefully)
diff --git a/lib/AnyEvent/Handle/UDP.pm b/lib/AnyEvent/Handle/UDP.pm
index 89fe485..49b898d 100644
--- a/lib/AnyEvent/Handle/UDP.pm
+++ b/lib/AnyEvent/Handle/UDP.pm
@@ -11,8 +11,7 @@ use AnyEvent::Socket qw/parse_address/;
use Carp qw/croak/;
use Errno qw/EAGAIN EWOULDBLOCK EINTR ETIMEDOUT/;
use Scalar::Util qw/reftype looks_like_number weaken openhandle/;
-use Socket qw/SOL_SOCKET SO_REUSEADDR SOCK_DGRAM INADDR_ANY AF_INET sockaddr_family/;
-BEGIN { *AF_INET6 = defined &Socket::AF_INET6 ? \&Socket::AF_INET6 : sub () { -1 } }
+use Socket qw/SOL_SOCKET SO_REUSEADDR SOCK_DGRAM INADDR_ANY AF_INET AF_INET6 sockaddr_family/;
use Symbol qw/gensym/;
BEGIN {
@@ -249,7 +248,7 @@ sub _get_family {
my $fh = shift;
return if !openhandle($fh) || !getsockname $fh;
my $family = sockaddr_family(getsockname $fh);
- return $family == AF_INET ? 4 : $family == AF_INET6 ? 6 : 0;
+ return +($family == AF_INET) ? 4 : $family == AF_INET6 ? 6 : 0;
}
sub _on_addr {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-handle-udp-perl.git
More information about the Pkg-perl-cvs-commits
mailing list