]> granicus.if.org Git - php/commitdiff
Remove debug code from usleep()
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jun 2020 12:51:58 +0000 (14:51 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jun 2020 12:51:58 +0000 (14:51 +0200)
This was added to debug CI failures, but ultimately didn't help
understand the macos timing issues. Drop it now so it's not
forgotten...

ext/standard/basic_functions.c

index 056bc0ac37d36b0e34e2412617b83edb5eb791f2..0a429963bd59d59110190d89a1810216376dcb5f 100755 (executable)
@@ -1242,7 +1242,6 @@ PHP_FUNCTION(sleep)
    Delay for a given number of micro seconds */
 PHP_FUNCTION(usleep)
 {
-#if HAVE_USLEEP
        zend_long num;
 
        ZEND_PARSE_PARAMETERS_START(1, 1)
@@ -1253,12 +1252,9 @@ PHP_FUNCTION(usleep)
                zend_argument_value_error(1, "must be greater than or equal to 0");
                RETURN_THROWS();
        }
-       if (usleep((unsigned int)num) < 0) {
-#if ZEND_DEBUG
-               php_error_docref(NULL, E_NOTICE, "usleep() failed with errno %d: %s",
-                       errno, strerror(errno));
-#endif
-       }
+
+#if HAVE_USLEEP
+       usleep((unsigned int)num);
 #endif
 }
 /* }}} */