CC: | 10014530 [...] ticket.noris.net |
Subject: | check for EINPROGRESS does not work for non-English locale |
In newFromInAddr(), Net::Ident handles a failed connect() like this:
connect($self->{fh}, $identbind) or ($e=$!) =~ /in progress/ or
die "= connect failed: $e\n";
This, however, won't work when LC_MESSAGES is set to non-English, e.g.:
$ locale | fgrep LC_MESSAGES
LC_MESSAGES="de_DE.UTF-8"
$ perl -MErrno=EINPROGRESS -le '$!=EINPROGRESS;print $!'
Die Operation ist jetzt in Bearbeitung
Therefore, I suggest applying the patch which you'll find attached to
this message to compare with the constant EINPROGRESS which can be
imported from Errno.pm.
Regards,
fany
Subject: | Ident-Errno.patch |
--- /usr/local/lib/perl5/site_perl/5.10.0/Net/Ident.pm 1999-08-27 00:58:15.000000000 +0200
+++ Ident.pm 2009-03-25 12:27:16.302859846 +0100
@@ -4,6 +4,7 @@
package Net::Ident;
use strict;
+use Errno 'EINPROGRESS';
use Socket;
use Fcntl;
use FileHandle;
@@ -170,7 +171,7 @@
# connect it to the remote identd port, this can return EINPROGRESS.
# for some reason, reading $! twice doesn't work as it should
- connect($self->{fh}, $identbind) or ($e=$!) =~ /in progress/ or
+ connect($self->{fh}, $identbind) or ($e=$!) == EINPROGRESS or
die "= connect failed: $e\n";
};
if ( $@ =~ /^= (.*)/ ) {