Page MenuHomePhabricator

Pass an integer to stream_select() for correctness
ClosedPublic

Authored by epriestley on Mar 19 2014, 12:09 PM.
Tags
None
Referenced Files
F19104644: D8567.id.diff
Dec 5 2025, 2:52 PM
F19095761: D8567.diff
Dec 4 2025, 6:01 AM
F19073880: D8567.id20333.diff
Dec 1 2025, 3:26 AM
F19061633: D8567.diff
Nov 29 2025, 1:03 PM
F19051782: D8567.diff
Nov 28 2025, 2:08 AM
F18869929: D8567.id.diff
Nov 4 2025, 2:24 PM
F18864470: D8567.diff
Nov 3 2025, 5:44 AM
F18856043: D8567.diff
Nov 1 2025, 7:42 AM
Subscribers

Details

Summary

Ref T4627. Passing $timeout_sec is slightly more correct here, although there is no change to program behavior.

Test Plan

Used this script to verify that passing 0 and 0.999321 (for example) have the same effect to stream_select():

<?php

$spec = array(
  0 => array('pipe', 'r'),
  1 => array('pipe', 'w'),
  2 => array('pipe', 'w'),
);

$pipes = array();
$proc = proc_open('sleep 30', $spec, $pipes);
list($stdin, $stdout, $stderr) = $pipes;

$read = array($stdout, $stderr);
$write = array();
$except = array();

$select_start = microtime(true);
stream_select($read, $write, $except, 0.999321, 80000);
$select_end = microtime(true);

printf(
  "select() took %d us to return.\n",
  ($select_end - $select_start) * 1000000);

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Pass an integer to stream_select() for correctness.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Mar 19 2014, 5:12 PM
epriestley updated this revision to Diff 20335.

Closed by commit rPHUa5fd944af95d (authored by @epriestley).