diff options
author | John Hood <cgull@glup.org> | 2016-05-24 10:57:54 -0400 |
---|---|---|
committer | John Hood <cgull@glup.org> | 2016-05-24 15:13:12 -0400 |
commit | 30eb5bb515f387c58cb3722cfd3038f48dcf6dfb (patch) | |
tree | dd20abcca59cb713a4a2cdd14abe2130f82bc290 /scripts | |
parent | 5bc1c6c032e91afc8017f22a4dd7ed52b3f8da71 (diff) |
mosh.pl: restore compatibility with older Socket module.
Also require Perl 5.14, which is the new compatibility
floor.
Fixes #758.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mosh.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/mosh.pl b/scripts/mosh.pl index b89086a..07f8f26 100755 --- a/scripts/mosh.pl +++ b/scripts/mosh.pl @@ -30,12 +30,15 @@ # this exception statement from all source files in the program, then # also delete it here. +use 5.14.0; + use warnings; use strict; use Getopt::Long; use IO::Socket; use Text::ParseWords; -use Socket qw( :addrinfo IPPROTO_IP IPPROTO_IPV6 IPPROTO_TCP IPPROTO_UDP ); +use Socket qw( getaddrinfo getnameinfo AI_CANONNAME AI_NUMERICHOST NI_NUMERICHOST + IPPROTO_IP IPPROTO_IPV6 IPPROTO_TCP IPPROTO_UDP ); use Errno qw(EINTR); use POSIX qw(_exit); @@ -473,7 +476,7 @@ sub resolvename { ( $err, @res ) = getaddrinfo( $host, $port, \%hints ); die "$0: could not get canonical name for $host: ${err}\n" if $err; # Then get final resolution of the canonical name. - $hints{flags} = undef; + delete $hints{flags}; my @newres; ( $err, @newres ) = getaddrinfo( $res[0]{canonname}, $port, \%hints ); die "$0: could not resolve canonical name ${res[0]{canonname}} for ${host}: ${err}\n" if $err; |