From: Hrunting Johnson Date: Mon, 14 Jul 2003 05:37:02 +0000 (+0000) Subject: [perl #22965] Cannot set undef timeout in IO::Socket in perl 5.8.0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96e47f5ba733cae0f440f31ded7475fca1ce9a66;p=p5sagit%2Fp5-mst-13.2.git [perl #22965] Cannot set undef timeout in IO::Socket in perl 5.8.0 From: Hrunting Johnson (via RT) Message-ID: p4raw-id: //depot/perl@20193 --- diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm index 7f434d9..f8c3cb3 100644 --- a/ext/IO/lib/IO/Socket.pm +++ b/ext/IO/lib/IO/Socket.pm @@ -273,9 +273,9 @@ sub atmark { sub timeout { @_ == 1 || @_ == 2 or croak 'usage: $sock->timeout([VALUE])'; my($sock,$val) = @_; - my $r = ${*$sock}{'io_socket_timeout'} || undef; + my $r = ${*$sock}{'io_socket_timeout'}; - ${*$sock}{'io_socket_timeout'} = 0 + $val + ${*$sock}{'io_socket_timeout'} = defined $val ? 0 + $val : $val if(@_ == 2); $r;