Skip to content

Commit 32edeab

Browse files
committed
poll: fix association error handling for eventport
It is to ignore invalid FDs
1 parent 6c68d0d commit 32edeab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main/poll/poll_backend_eventport.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,13 @@ static bool eventport_associate_callback(int fd, php_poll_fd_entry *entry, void
232232
== -1) {
233233
/* Association failed - could set error here if needed */
234234
switch (errno) {
235+
case EBADFD:
236+
/* fd got closed - remove it */
237+
php_poll_fd_table_remove(assoc_ctx->backend_data->fd_table, fd);
238+
return true;
235239
case ENOMEM:
236240
php_poll_set_error(assoc_ctx->ctx, PHP_POLL_ERR_NOMEM);
237241
break;
238-
case EBADF:
239242
case EINVAL:
240243
php_poll_set_error(assoc_ctx->ctx, PHP_POLL_ERR_INVALID);
241244
break;

0 commit comments

Comments
 (0)