summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-09-03 20:19:55 +0900
committerNobuyoshi Nakada <[email protected]>2024-09-04 10:42:48 +0900
commit37d7ae06afb03ae5508bfd81033961559886bd6b (patch)
tree2f13ca5e917a45c2296b36c8d5473bc8a5dc71bc /io.c
parentade240e5785eac173978304ca9acfe10d08f057e (diff)
[Bug #20708] Retry `open` on EINTR
Co-Authored-By: Martin Dorey <[email protected]>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11537
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/io.c b/io.c
index 54b60b7357..590e8d11d7 100644
--- a/io.c
+++ b/io.c
@@ -6956,7 +6956,10 @@ sysopen_func(void *ptr)
static inline int
rb_sysopen_internal(struct sysopen_struct *data)
{
- int fd = IO_WITHOUT_GVL_INT(sysopen_func, data);
+ int fd;
+ do {
+ fd = IO_WITHOUT_GVL_INT(sysopen_func, data);
+ } while (fd < 0 && errno == EINTR);
if (0 <= fd)
rb_update_max_fd(fd);
return fd;