[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN
From: |
Andy Wingo |
Subject: |
[Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN. |
Date: |
Tue, 7 Aug 2018 06:58:29 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 666f12c8714349ca791c361653ea9c492292d995
Author: Ludovic Courtès <address@hidden>
Date: Fri Feb 16 14:05:04 2018 +0100
'select' returns empty sets upon EINTR and EAGAIN.
Fixes <https://bugs.gnu.org/30368>.
* libguile/filesys.c (scm_select): Clear READ_SET, WRITE_SET, and
EXCEPT_SET when RV < 0.
---
libguile/filesys.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 0e4a0cf..7713c0a 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -906,10 +906,20 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
int rv = scm_std_select (max_fd + 1,
&read_set, &write_set, &except_set,
time_ptr);
- /* Let EINTR / EAGAIN cause a return to the user and let them loop
- to run any asyncs that might be pending. */
- if (rv < 0 && errno != EINTR && errno != EAGAIN)
- SCM_SYSERROR;
+ if (rv < 0)
+ {
+ /* Let EINTR / EAGAIN cause a return to the user and let them
+ loop to run any asyncs that might be pending. */
+ if (errno != EINTR && errno != EAGAIN)
+ SCM_SYSERROR;
+ else
+ {
+ /* Return empty sets. */
+ FD_ZERO (&read_set);
+ FD_ZERO (&write_set);
+ FD_ZERO (&except_set);
+ }
+ }
}
return scm_list_3 (retrieve_select_type (&read_set, read_ports_ready, reads),
- [Guile-commits] 04/58: 'load-thunk-from-memory' reports the correct error., (continued)
- [Guile-commits] 04/58: 'load-thunk-from-memory' reports the correct error., Andy Wingo, 2018/08/07
- [Guile-commits] 13/58: srfi-18: 'thread-sleep!' timeout-as-a-number is relative., Andy Wingo, 2018/08/07
- [Guile-commits] 18/58: Fix typo in comment within numbers.c, Andy Wingo, 2018/08/07
- [Guile-commits] 08/58: Revert "Honor '%fresh-auto-compile'.", Andy Wingo, 2018/08/07
- [Guile-commits] 15/58: Fix eta-conversion edge cases in peval., Andy Wingo, 2018/08/07
- [Guile-commits] 17/58: Fix minor typo in the PEG documentation., Andy Wingo, 2018/08/07
- [Guile-commits] 20/58: Avoid inexact arithmetic in the type inferrer for 'sqrt'., Andy Wingo, 2018/08/07
- [Guile-commits] 16/58: Fix a few typos in the manual., Andy Wingo, 2018/08/07
- [Guile-commits] 05/58: compile: Load language modules upfront., Andy Wingo, 2018/08/07
- [Guile-commits] 11/58: doc: Fix typo about SRFI-4 syntax., Andy Wingo, 2018/08/07
- [Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN.,
Andy Wingo <=
- [Guile-commits] 14/58: Recognize RISC-V compilation targets., Andy Wingo, 2018/08/07
- [Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that aren't structs., Andy Wingo, 2018/08/07
- [Guile-commits] 10/58: build: Use 'sed' invocation compatible with BSD sed., Andy Wingo, 2018/08/07
- [Guile-commits] 24/58: Add copyright header for (language elisp falias), and fix typo., Andy Wingo, 2018/08/07
- [Guile-commits] 29/58: get-bytevector-n and get-bytevector-n! can now read more than 4 GB, Andy Wingo, 2018/08/07
- [Guile-commits] 26/58: tests: Add SRFI-71 test., Andy Wingo, 2018/08/07
- [Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to UTF-8., Andy Wingo, 2018/08/07
- [Guile-commits] 12/58: srfi-18: When timeout is a number, it's a relative number of seconds., Andy Wingo, 2018/08/07
- [Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'., Andy Wingo, 2018/08/07
- [Guile-commits] 19/58: Fix type inference for bitwise logical operators., Andy Wingo, 2018/08/07