[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

[Patch] check return from io_seek()

From: Michal Rokos <michal@...>
Date: 2004-06-23 11:12:20 UTC
List: ruby-core #3045
Hello,

Shouldn't we check the ret. val from io_seek() MACRO/fseek(o) func?

We do so, but it's missing here (see below)

	Michal

Index: io.c
===================================================================
RCS file: /var/cvs/src/ruby/io.c,v
retrieving revision 1.280
diff -u -p -r1.280 io.c
--- io.c        22 Jun 2004 15:00:34 -0000      1.280
+++ io.c        23 Jun 2004 09:58:05 -0000
@@ -3176,8 +3176,12 @@ io_reopen(io, nfile)
        }
        rb_thread_fd_close(fd);
        if ((orig->mode & FMODE_READABLE) && pos >= 0) {
-           io_seek(fptr, pos, SEEK_SET);
-           io_seek(orig, pos, SEEK_SET);
+           if (io_seek(fptr, pos, SEEK_SET) != 0) {
+               rb_sys_fail(fptr->path);
+           }
+           if (io_seek(orig, pos, SEEK_SET) != 0) {
+               rb_sys_fail(orig->path);
+           }
        }
     }


In This Thread

Prev Next