php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35900 stream_select() should warning when tv_sec is negative
Submitted: 2006-01-05 03:39 UTC Modified: 2006-04-19 08:44 UTC
From: sqchen at citiz dot net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.1.1 OS: redhat 7.3
Private report: No CVE-ID: None
 [2006-01-05 03:39 UTC] sqchen at citiz dot net
Description:
------------
int stream_select ( array &read, array &write, array &except, int tv_sec [, int tv_usec] )


when tv_sec= -1, tv_usec=6000000, it should warning, not wait 5 seconds.

Reproduce code:
---------------
<?php
$read = array(STDIN);
if($num_changed_streams = stream_select($read, $write=NULL , $except = NULL, -1,6000000))
{
        echo "Pass";
}
else
{
        echo "Fail";
}
?>


Expected result:
----------------
warning: Invalid argument (max_fd=0) 

Actual result:
--------------
wait 5 seconds for input

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-05 10:05 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-01-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-23 03:26 UTC] sqchen at citiz dot net
sorry for my late response, I have tried the cvs version   http://snaps.php.net/php5.1-latest.tar.gz, and the problem remains as before
 [2006-02-23 19:28 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2006-04-19 08:36 UTC] sqchen at citiz dot net
hi. I have tried it with the snapshot version and found that it's actully  not fixed correctory..

file: streamsfuncs.c 
line: 757
if(sec<0).....

while sec here is a address, so it should be:
if (Z_LVAL(*sec) < 0).......
 [2006-04-19 08:44 UTC] tony2001@php.net
Fixed in CVS.
Thanks for noticing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC