From: Katsuyuki Komatsu Date: 1999-09-22T09:29:32+09:00 Subject: [ruby-dev:7894] Re: socket and buffering 小松です。 In the message of [ruby-dev:7883] Re: socket and buffering on 1999/9/20 02:02:47 matz@netlab.co.jp (Yukihiro Matsumoto) wrote: |io.cの関数rb_io_unbufferedに手をいれて(名称も変更して) |FMODE_SYNC の設定だけを行うようにしてみます。 ftplib.rbのgetbinaryfile()が失敗したので気づいたのですが、 9/20のio.cのio_fread()はデータに0xffがあるとちょっとまずいです。 あとはmswin32対応で、名称変更に伴うwin32/ruby.defのパッチと、 ruby.defを変更したのにrubymw.dllが作り直されなかったため win32/Makefileにも手を入れました。 Index: io.c =================================================================== RCS file: /home/cvs/ruby/io.c,v retrieving revision 1.4 diff -u -1 -p -r1.4 io.c --- io.c 1999/09/20 07:14:18 1.4 +++ io.c 1999/09/22 00:06:07 @@ -451,6 +451,7 @@ io_fread(ptr, len, f) size_t n = len; + int c; while (n--) { - *ptr = getc(f); - if (*ptr == EOF) { + c = getc(f); + if (c == EOF) { *ptr = '\0'; @@ -458,3 +459,3 @@ io_fread(ptr, len, f) } - ptr++; + *ptr++ = c; if (!READ_DATA_PENDING(f)) { Index: win32/Makefile =================================================================== RCS file: /home/cvs/ruby/win32/Makefile,v retrieving revision 1.3 diff -u -1 -p -r1.3 Makefile --- win32/Makefile 1999/08/24 08:21:56 1.3 +++ win32/Makefile 1999/09/22 00:06:07 @@ -100,4 +100,4 @@ $(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(LIBR -$(LIBRUBY_A): $(OBJS) - lib -nologo /OUT:$@ $(OBJS) +$(LIBRUBY_A): $(OBJS) dmyext.obj + lib -nologo /OUT:$@ $(OBJS) dmyext.obj @@ -106,3 +106,3 @@ rubymw.lib: ruby.def -$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) +$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) ruby.def set LIB=.\win32;$(ORGLIBPATH) Index: win32/ruby.def =================================================================== RCS file: /home/cvs/ruby/win32/ruby.def,v retrieving revision 1.3 diff -u -1 -p -r1.3 ruby.def --- win32/ruby.def 1999/08/24 08:21:56 1.3 +++ win32/ruby.def 1999/09/22 00:06:07 @@ -35,2 +35,3 @@ EXPORTS rb_cProc + ruby_frame rb_cThread @@ -74,2 +75,4 @@ EXPORTS rb_cRegexp +;regex.c + re_mbctab ;ruby.c @@ -372,3 +375,3 @@ EXPORTS rb_file_sysopen - rb_io_unbuffered + rb_io_synchronized rb_p -- 小松克行 / Katsuyuki Komatsu