aboutsummaryrefslogtreecommitdiffstats
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
commit9b25eee46e5acba4a651bf1d1fde2de1153178f7 (patch)
tree8313c49152faf5bcfed7a8b30eae3375dbb97e11
parent643ac551dc5d58fbf63a1ae253dbdbe941778abd (diff)
downloadruby-9b25eee46e5acba4a651bf1d1fde2de1153178f7.tar.gz
* io.c (io_reopen): work around problem with Cygwin fseeko
returning ESPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/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 6c05c30466..55b95cf92a 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 e081477772..f3b40e8363 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) {