Skip to content

Commit 96840a2

Browse files
committed
Add debugging code to usleep()
To see if intermittent CI failures are caused by a signal interrupt.
1 parent 16f4fa0 commit 96840a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/standard/basic_functions.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3904,7 +3904,12 @@ PHP_FUNCTION(usleep)
39043904
php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
39053905
RETURN_FALSE;
39063906
}
3907-
usleep((unsigned int)num);
3907+
if (usleep((unsigned int)num) < 0) {
3908+
#if ZEND_DEBUG
3909+
php_error_docref(NULL, E_NOTICE, "usleep() failed with errno %d: %s",
3910+
errno, strerror(errno));
3911+
#endif
3912+
}
39083913
#endif
39093914
}
39103915
/* }}} */

0 commit comments

Comments
 (0)