OCaml 4.14.0 rebuild
[arch-packages.git] / curl / trunk / 0001-select-do-not-return-fatal-error-on-EINTR-from-poll.patch
blobc2456da0e1d7f384663ec5dda4c40d70063429c5
1 From 52e822173aa3cd4f610531d32fbf943f026cdca6 Mon Sep 17 00:00:00 2001
2 From: Thomas Weißschuh <thomas@t-8ch.de>
3 Date: Sun, 3 Jul 2022 18:20:44 +0200
4 Subject: select: do not return fatal error on EINTR from poll()
6 The same was done for select() in 5912da25 but poll() was missed.
8 Bug: https://bugs.archlinux.org/task/75201
9 Reported-by: Alexandre Bury (gyscos at archlinux)
11 Ref: https://github.com/curl/curl/issues/8921
12 Ref: https://github.com/curl/curl/pull/8961
13 Ref: https://github.com/curl/curl/commit/5912da25#r77584294
15 Closes https://github.com/curl/curl/pull/9091
16 ---
17 lib/select.c | 6 +++++-
18 1 file changed, 5 insertions(+), 1 deletion(-)
20 diff --git a/lib/select.c b/lib/select.c
21 index c16358d56..2ac074677 100644
22 --- a/lib/select.c
23 +++ b/lib/select.c
24 @@ -310,8 +310,12 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms)
25 else
26 pending_ms = 0;
27 r = poll(ufds, nfds, pending_ms);
28 - if(r <= 0)
29 + if(r <= 0) {
30 + if((r == -1) && (SOCKERRNO == EINTR))
31 + /* make EINTR from select or poll not a "lethal" error */
32 + r = 0;
33 return r;
34 + }
36 for(i = 0; i < nfds; i++) {
37 if(ufds[i].fd == CURL_SOCKET_BAD)
38 --
39 cgit v1.2.3-18-g5258