summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 17:54:58 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 17:54:58 +0000
commit59047a396446d98f529106cd0d9ed06de6f0061a (patch)
tree6b25a266f47358d25ce0aa0fc7ee97f06e89d020
parent718f7f3b1dadab9e9cbc037b2c57369cf682f0c1 (diff)
merge revision(s) 13774:
* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@16909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--io.c5
-rw-r--r--version.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c75712c5ea..4beb7ccfba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jun 8 02:54:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]
+
Sun Jun 8 01:51:52 2008 James Edward Gray II <jeg2@ruby-lang.org>
Merged 13767, 13768, 13769, and 13770 from trunk.
diff --git a/io.c b/io.c
index 09fd3d0433..47f06c60ce 100644
--- a/io.c
+++ b/io.c
@@ -245,6 +245,7 @@ flush_before_seek(fptr)
if (fptr->mode & FMODE_WBUF) {
io_fflush(GetWriteFile(fptr), fptr);
}
+ errno = 0;
return fptr;
}
@@ -668,7 +669,7 @@ rb_io_tell(io)
GetOpenFile(io, fptr);
pos = io_tell(fptr);
- if (pos < 0) rb_sys_fail(fptr->path);
+ if (pos < 0 && errno) rb_sys_fail(fptr->path);
return OFFT2NUM(pos);
}
@@ -683,7 +684,7 @@ rb_io_seek(io, offset, whence)
pos = NUM2OFFT(offset);
GetOpenFile(io, fptr);
pos = io_seek(fptr, pos, whence);
- if (pos < 0) rb_sys_fail(fptr->path);
+ if (pos < 0 && errno) rb_sys_fail(fptr->path);
clearerr(fptr->f);
return INT2FIX(0);
diff --git a/version.h b/version.h
index 984ad725a6..8233b528c6 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-08"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080608
-#define RUBY_PATCHLEVEL 137
+#define RUBY_PATCHLEVEL 138
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8