summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/io.c b/io.c
index 465b3d0a9..4c1691893 100644
--- a/io.c
+++ b/io.c
@@ -512,11 +512,16 @@ io_fread(ptr, len, f)
if (c == EOF) {
eof:
if (ferror(f)) {
- if (errno == EINTR) continue;
- if (errno == EAGAIN) return len - n;
+ switch (errno) {
+ case EINTR:
+ continue;
+
+ case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- if (errno == EWOULDBLOCK) return len - n;
+ case EWOULDBLOCK:
#endif
+ return len - n;
+ }
rb_sys_fail(0);
}
*ptr = '\0';