aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 03:44:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 03:44:09 +0000
commitf2aa0e5b0c0fb80f9400fae1bdc2bfccedbc314b (patch)
tree49213ee1a8b170e59646e0bb1fe65d9a70180072 /io.c
parentb84d31c524093f91932813a09853ab417f121dff (diff)
downloadruby-f2aa0e5b0c0fb80f9400fae1bdc2bfccedbc314b.tar.gz
* io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not
defined on every platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/io.c b/io.c
index 72db537873..96e75137ac 100644
--- a/io.c
+++ b/io.c
@@ -6590,9 +6590,16 @@ retry_sendfile:
}
}
if (ss == -1) {
- if (errno == EINVAL || errno == ENOSYS)
+ switch (errno) {
+ case EINVAL:
+#ifdef ENOSYS
+ case ENOSYS:
+#endif
return 0;
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
if (copy_stream_wait_write(stp) == -1)
return -1;
if (RUBY_VM_INTERRUPTED(stp->th))
@@ -6626,12 +6633,17 @@ retry_read:
return 0;
}
if (ss == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ switch (errno) {
+ case EAGAIN:
+#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
if (copy_stream_wait_read(stp) == -1)
return -1;
goto retry_read;
- }
- if (errno == ENOSYS) {
+#ifdef ENOSYS
+ case ENOSYS:
+#endif
stp->notimp = "pread";
return -1;
}