diff options
| author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-20 08:49:16 +0000 |
|---|---|---|
| committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-20 08:49:16 +0000 |
| commit | 0214aa6dd729130839f202e41f99876048707ec8 (patch) | |
| tree | 8313c49152faf5bcfed7a8b30eae3375dbb97e11 /io.c | |
| parent | dfa0294944e265944e73f7a06cde0b6b2a9b6051 (diff) | |
| download | ruby-0214aa6dd729130839f202e41f99876048707ec8.tar.gz ruby-0214aa6dd729130839f202e41f99876048707ec8.tar.xz ruby-0214aa6dd729130839f202e41f99876048707ec8.zip | |
* io.c (io_reopen): work around problem with Cygwin fseeko
returning ESPIPE.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -127,9 +127,6 @@ static VALUE lineno = INT2FIX(0); # define READ_DATA_PENDING_COUNT(fp) ((fp)->_egptr - (fp)->_gptr) # define READ_DATA_PENDING_PTR(fp) ((fp)->_gptr) # endif -#elif defined(HAVE___FPENDING) -# define READ_DATA_PENDING(fp) (__fpending(fp) > 0) -# define READ_DATA_PENDING_COUNT(fp) (__fpending(fp)) #elif defined(FILE_COUNT) # define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0) # define READ_DATA_PENDING_COUNT(fp) ((fp)->FILE_COUNT) @@ -3283,6 +3280,7 @@ io_reopen(io, nfile) fd = fileno(fptr->f); fd2 = fileno(orig->f); if (fd != fd2) { +#if !defined __CYGWIN__ if (fptr->f == stdin || fptr->f == stdout || fptr->f == stderr) { clearerr(fptr->f); /* need to keep stdio objects */ @@ -3290,11 +3288,14 @@ io_reopen(io, nfile) rb_sys_fail(orig->path); } else { +#endif fclose(fptr->f); if (dup2(fd2, fd) < 0) rb_sys_fail(orig->path); fptr->f = rb_fdopen(fd, mode); +#if !defined __CYGWIN__ } +#endif rb_thread_fd_close(fd); if ((orig->mode & FMODE_READABLE) && pos >= 0) { if (io_seek(fptr, pos, SEEK_SET) < 0) { |
