This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert change #24223 : select() will continue
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 16 Sep 2005 12:54:43 +0000 (12:54 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 16 Sep 2005 12:54:43 +0000 (12:54 +0000)
to return -1 on error, like in previous versions, and
like other system builtins.
p4raw-link: @24223 on //depot/perl: 5c477709a8f3aa3110d51ae872950c20ff14fed6

p4raw-id: //depot/perl@25418

pod/perl593delta.pod
pod/perlfunc.pod
pp_sys.c

index be27bd3..7d75352 100644 (file)
@@ -10,9 +10,6 @@ L<perl592delta> for the differences between 5.8.0 and 5.9.2.
 
 =head1 Incompatible Changes
 
-The 4-argument form of select() now returns C<undef> on error (instead of
--1).
-
 =head1 Core Enhancements
 
 =head1 Modules and Pragmata
index 2d6c40c..8054abb 100644 (file)
@@ -4673,7 +4673,8 @@ Note that whether C<select> gets restarted after signals (say, SIGALRM)
 is implementation-dependent.  See also L<perlport> for notes on the
 portability of C<select>.
 
-On error, C<select> returns C<undef> and sets C<$!>.
+On error, C<select> behaves like the select(2) system call : it returns
+-1 and sets C<$!>.
 
 Note: on some Unixes, the select(2) system call may report a socket file
 descriptor as "ready for reading", when actually no data is available,
index f082b4c..12d2ac6 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1148,10 +1148,7 @@ PP(pp_sselect)
        }
     }
 
-    if (nfound == -1)
-       PUSHs(&PL_sv_undef);
-    else
-       PUSHi(nfound);
+    PUSHi(nfound);
     if (GIMME == G_ARRAY && tbuf) {
        value = (NV)(timebuf.tv_sec) +
                (NV)(timebuf.tv_usec) / 1000000.0;