Closed p5pRT closed 20 years ago
There is a problem with IO::Socket::_error\, in that it tries to do a 'close' on the socket\, and this is not always successful. If not\, it unhelpfully obliterates the $! variable setting that the socket error created. Localising $! fixes this:
*** Socket.pm.orig Fri May 15 15:33:14 1998 --- Socket.pm Fri Jun 18 10:40:17 1999 *************** *** 523\,526 **** --- 523\,527 ---- $@ = join(""\,ref($fh)\,": "\,@_); carp $@ if $^W; + local $!; close($fh) if(defined fileno($fh));
This patch is actually based on 5.00551 source code; I note that IO/Socket.pm has a change from that shipped with 5.00404 although the version number is the same at 1.1603:
*** /u2/src/perl5.005_51/lib/IO/Socket.pm Fri Jun 18 10:40:17 1999
--- /u2/src/perl5.004_04/lib/IO/Socket.pm Fri Sep 19 18:05:56 1997
***************
*** 187\,191 ****
my $fh2 = $class->new();
! socketpair($fh1\,$fh2\,$domain\,$type\,$protocol) or
return ();
--- 187\,191 ----
my $fh2 = $class->new();
! socketpair($fh1\,$fh1\,$domain\,$type\,$protocol) or
return ();
Migrated from rt.perl.org#881 (status was 'resolved')
Searchable as RT881$