diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-05 03:44:09 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-05 03:44:09 +0000 |
| commit | 20ce211af49a82dc210bf968b5b9ca95b09ba083 (patch) | |
| tree | 49213ee1a8b170e59646e0bb1fe65d9a70180072 | |
| parent | ab09f3e4297dc9a9dbdc190ad80a9185b6eb4a1f (diff) | |
| download | ruby-20ce211af49a82dc210bf968b5b9ca95b09ba083.tar.gz ruby-20ce211af49a82dc210bf968b5b9ca95b09ba083.tar.xz ruby-20ce211af49a82dc210bf968b5b9ca95b09ba083.zip | |
* io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not
defined on every platforms.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 22 |
2 files changed, 22 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Tue Aug 5 12:43:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are not + defined on every platforms. + Tue Aug 5 12:34:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * transcode_data.h (TRANSCODE_ERROR): common transcode failure @@ -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; } |
