summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-20 08:49:16 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-20 08:49:16 +0000
commit0214aa6dd729130839f202e41f99876048707ec8 (patch)
tree8313c49152faf5bcfed7a8b30eae3375dbb97e11
parentdfa0294944e265944e73f7a06cde0b6b2a9b6051 (diff)
downloadruby-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
-rw-r--r--ChangeLog5
-rw-r--r--io.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c05c3046..55b95cf92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Nov 20 17:48:29 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * io.c (io_reopen): work around problem with Cygwin fseeko
+ returning ESPIPE.
+
Tue Nov 20 05:34:24 2004 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: original nkf.c rev:1.40
diff --git a/io.c b/io.c
index e08147777..f3b40e836 100644
--- a/io.c
+++ b/io.c
@@ -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) {