File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/Symfony/Component/Process/Pipes Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,26 @@ public function close(): void
52
52
53
53
/**
54
54
* Returns true if a system call has been interrupted.
55
+ *
56
+ * stream_select() returns false when the `select` system call is interrupted by an incoming signal.
55
57
*/
56
58
protected function hasSystemCallBeenInterrupted (): bool
57
59
{
58
60
$ lastError = $ this ->lastError ;
59
61
$ this ->lastError = null ;
60
62
61
- // stream_select returns false when the `select` system call is interrupted by an incoming signal
62
- return null !== $ lastError && false !== stripos ($ lastError , 'interrupted system call ' );
63
+ if (null === $ lastError ) {
64
+ return false ;
65
+ }
66
+
67
+ if (false !== stripos ($ lastError , 'interrupted system call ' )) {
68
+ return true ;
69
+ }
70
+
71
+ // on applications with a different locale than english, the message above is not found because
72
+ // it's translated. So we also check for the SOCKET_EINTR constant which is defined under
73
+ // Windows and UNIX-like platforms (if available on the platform).
74
+ return \defined ('SOCKET_EINTR ' ) && str_starts_with ($ lastError , 'stream_select(): Unable to select [ ' .\SOCKET_EINTR .'] ' );
63
75
}
64
76
65
77
/**
You can’t perform that action at this time.
0 commit comments