]> granicus.if.org Git - php/commitdiff
MFH: Fix for #24629
authorWez Furlong <wez@php.net>
Thu, 24 Jul 2003 15:23:14 +0000 (15:23 +0000)
committerWez Furlong <wez@php.net>
Thu, 24 Jul 2003 15:23:14 +0000 (15:23 +0000)
ext/standard/file.c

index 82c9c8b2f48aaa8815c44c13b6ef6690fe8d8bd7..334fcc18558d4e42f8f04bfa99744da337e1100c 100644 (file)
@@ -808,8 +808,14 @@ PHP_FUNCTION(stream_select)
        /* If seconds is not set to null, build the timeval, else we wait indefinitely */
        if (sec != NULL) {
                convert_to_long_ex(&sec);
-               tv.tv_sec = Z_LVAL_P(sec);
-               tv.tv_usec = usec;
+
+               if (usec > 999999) {
+                       tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000);
+                       tv.tv_usec = usec % 1000000;
+               } else {
+                       tv.tv_sec = Z_LVAL_P(sec);
+                       tv.tv_usec = usec;
+               }
                tv_p = &tv;
        }