Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

Patch for IO::Socket #78

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#881 (status was 'resolved')

Searchable as RT881$

p5pRT commented 24 years ago

From ian@dial.pipex.com

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 ();  

Perl Info ``` This perlbug was built using Perl 5.00551 - Mon Oct 26 11:39:16 GMT 1998 It is being executed now by Perl 5.00404 - Sun Apr 26 12:56:41 BST 1998. Site configuration information for perl 5.00404: Configured by ian at Sun Apr 26 12:56:41 BST 1998. Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration: Platform: osname=linux, osvers=2.0.0, archname=i586-linux uname='linux penstock 2.0.0 #1 mon jan 20 15:07:14 gmt 1997 i586 ' hint=previous, useposix=true, d_sigaction=define bincompat3=n useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2', gccversion=2.7.2 cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' stdchar='char', d_stdstdio=define, usevfork=false voidflags=15, castflags=0, d_casti32=define, d_castneg=define intsize=4, alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lgdbm -ldb -ldl -lm -lc libc=/lib/libc.so.5.3.12, so=so useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl 5.00404: /u2/ian/lib/perl5 /usr/local/lib/perl5/i586-linux/5.00404 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/i586-linux /usr/local/lib/perl5/site_perl . Environment for perl 5.00404: HOME=/u2/ian LANG (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/u2/ian/cmd:/u2/ian/Linux:/usr/local/bin:/u2/ian/stocks/cmd:/usr/openwin/bin:/usr/bin/X11:/usr/bin:/bin:/usr/lib/teTeX/bin:/usr/etc:/sbin:/usr/sbin PERL5LIB=/u2/ian/lib/perl5 PERL_BADLANG (unset) SHELL=/bin/zsh ```