@@ -265,18 +265,20 @@ static zend_always_inline void handle_exception_and_errno(void)
265
265
zend_class_entry * default_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_DEFAULT );
266
266
zend_class_entry * cancellation_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_CANCELLATION );
267
267
zend_class_entry * timeout_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_TIMEOUT );
268
+ zend_class_entry * io_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_INPUT_OUTPUT );
268
269
269
270
if (instanceof_function (error -> ce , cancellation_ce )) {
270
271
errno = ECANCELED ;
271
272
} else if (error -> ce == timeout_ce ) {
272
273
errno = ETIMEDOUT ;
273
274
should_throw = false;
274
- } else if (instanceof_function (error -> ce , default_ce )) {
275
- errno = EINTR ;
275
+ } else if (instanceof_function (error -> ce , default_ce )
276
+ || instanceof_function (error -> ce , io_ce )) {
277
+ errno = EBADF ;
276
278
should_throw = false;
277
279
as_warning = true;
278
280
} else {
279
- errno = EINTR ;
281
+ errno = EBADF ;
280
282
}
281
283
282
284
if (false == should_throw ) {
@@ -285,13 +287,13 @@ static zend_always_inline void handle_exception_and_errno(void)
285
287
286
288
if (as_warning ) {
287
289
zend_exception_error (error , E_WARNING );
290
+ } else {
291
+ OBJ_RELEASE (error );
288
292
}
289
-
290
- OBJ_RELEASE (error );
291
293
}
292
294
293
295
} else {
294
- errno = EINTR ;
296
+ errno = EBADF ;
295
297
}
296
298
}
297
299
@@ -665,21 +667,23 @@ static zend_always_inline void dns_handle_exception_and_errno(void)
665
667
zend_class_entry * cancellation_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_CANCELLATION );
666
668
zend_class_entry * timeout_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_TIMEOUT );
667
669
zend_class_entry * dns_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_DNS );
670
+ zend_class_entry * io_ce = ZEND_ASYNC_GET_EXCEPTION_CE (ZEND_ASYNC_EXCEPTION_INPUT_OUTPUT );
668
671
669
672
if (instanceof_function (error -> ce , cancellation_ce )) {
670
673
errno = ECANCELED ;
671
674
} else if (error -> ce == timeout_ce ) {
672
675
errno = ETIMEDOUT ;
673
676
should_throw = false;
674
677
} else if (error -> ce == dns_ce ) {
675
- errno = EINTR ;
678
+ errno = EBADF ;
676
679
should_throw = false;
677
- } else if (instanceof_function (error -> ce , default_ce )) {
678
- errno = EINTR ;
680
+ } else if (instanceof_function (error -> ce , default_ce )
681
+ || instanceof_function (error -> ce , io_ce )) {
682
+ errno = EBADF ;
679
683
should_throw = false;
680
684
as_warning = true;
681
685
} else {
682
- errno = EINTR ;
686
+ errno = EBADF ;
683
687
}
684
688
685
689
if (false == should_throw ) {
@@ -694,7 +698,7 @@ static zend_always_inline void dns_handle_exception_and_errno(void)
694
698
}
695
699
696
700
} else {
697
- errno = EINTR ;
701
+ errno = EBADF ;
698
702
}
699
703
}
700
704
0 commit comments