From 05225dcb984393a2bacfccf0ffc12c39ee74b640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 16 Mar 2023 12:01:16 +0100 Subject: [PATCH] Support checking `EINTR` constant from `ext-pcntl` without `ext-sockets` --- src/StreamSelectLoop.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/StreamSelectLoop.php b/src/StreamSelectLoop.php index 71983da0..1686fd74 100644 --- a/src/StreamSelectLoop.php +++ b/src/StreamSelectLoop.php @@ -290,7 +290,8 @@ private function streamSelect(array &$read, array &$write, $timeout) /** @var ?callable $previous */ $previous = \set_error_handler(function ($errno, $errstr) use (&$previous) { // suppress warnings that occur when `stream_select()` is interrupted by a signal - $eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : 4; + // PHP defines `EINTR` through `ext-sockets` or `ext-pcntl`, otherwise use common default (Linux & Mac) + $eintr = \defined('SOCKET_EINTR') ? \SOCKET_EINTR : (\defined('PCNTL_EINTR') ? \PCNTL_EINTR : 4); if ($errno === \E_WARNING && \strpos($errstr, '[' . $eintr .']: ') !== false) { return; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy