Skip to content

Commit 8670d1a

Browse files
committed
Return false even on EAGAIN
1 parent 26adbad commit 8670d1a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/pcntl/pcntl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,11 @@ PHP_FUNCTION(pcntl_sigtimedwait)
916916
timeout.tv_sec = (time_t) tv_sec;
917917
timeout.tv_nsec = tv_nsec;
918918
int signal_no = sigtimedwait(&set, &siginfo, &timeout);
919-
// TODO Drop check for EAGAIN as it will return -1?
920-
if (signal_no == -1 && errno != EAGAIN) {
921-
PCNTL_G(last_error) = errno;
922-
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
919+
if (signal_no == -1) {
920+
if (errno != EAGAIN) {
921+
PCNTL_G(last_error) = errno;
922+
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
923+
}
923924
RETURN_FALSE;
924925
}
925926

0 commit comments

Comments
 (0)