[#23717] error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。どうしても原因がわからないので、報告だけ・・・

18 messages 2004/06/19
[#23718] Re: error at TestDRbMServer (test/drb) — nobu.nakada@... 2004/06/19

なかだです。

[#23719] Re: error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/06/19

山本です。

[#23720] Re: error at TestDRbMServer (test/drb) — nobu.nakada@... 2004/06/19

なかだです。

[#23724] Re: error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/06/19

山本です。

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

まつもと ゆきひろです

40 messages 2004/06/23

[#23784] URI() — Tanaka Akira <akr@...17n.org>

前から思っていたのですが、URI.parse("http://...") を URI("http://...")

19 messages 2004/06/25

[ruby-dev:23730] Re test/ruby/test_pipe.rb fails in bcc32

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2004-06-21 03:38:44 UTC
List: ruby-dev #23730
山本です。

>これだと本当のエラーまで隠してしまって、まずそうです。

と書きましたが、win32/win32.c(rb_w32_getc) では既に EPIPE ==> EOF とみなして
いる様なので、fread でも同じようにしてみました
(bcc32 と wince で rb_w32_fread を定義しました)

 * win32/win32.c(rb_w32_fread): fread で errno == EPIPE となったときは、
   エラーフラグをクリアして、EOF フラグを立てる

Index: win32.h
===================================================================
RCS file: /var/cvs/src/ruby/win32/win32.h,v
retrieving revision 1.51
diff -u -w -b -p -r1.51 win32.h
--- win32.h	19 Feb 2004 09:08:23 -0000	1.51
+++ win32.h	21 Jun 2004 02:46:25 -0000
@@ -122,6 +122,11 @@ extern "C++" {
 #undef execv
 #define execv(path,argv)	rb_w32_aspawn(P_OVERLAY,path,argv)
 
+#if defined __BORLANDC__ || _WIN32_WCE
+#undef fread
+#define fread(p, m, n, stream)	rb_w32_fread(p, m, n, stream)
+#endif
+
 #ifdef __MINGW32__
 struct timezone {
   int tz_minuteswest;

Index: win32.c
===================================================================
RCS file: /var/cvs/src/ruby/win32/win32.c,v
retrieving revision 1.117
diff -u -w -b -p -r1.117 win32.c
--- win32.c	21 Jun 2004 00:27:39 -0000	1.117
+++ win32.c	21 Jun 2004 03:12:44 -0000
@@ -3034,10 +3034,14 @@ rb_w32_getc(FILE* stream)
     else 
 #endif
     {
+#if defined __BORLANDC__ || defined _WIN32_WCE
+	errno = 0;
+#endif
 	c = _filbuf(stream);
 #if defined __BORLANDC__ || defined _WIN32_WCE
         if ((c == EOF) && (errno == EPIPE)) {
 	    clearerr(stream);
+	    stream->flags |= _F_EOF;
         }
 #endif
 	rb_trap_immediate = trap_immediate;
@@ -3065,6 +3069,22 @@ rb_w32_putc(int c, FILE* stream)
     }
     return c;
 }
+
+#if defined __BORLANDC__ || defined _WIN32_WCE
+#undef fread
+size_t
+rb_w32_fread(void *ptr, size_t size, size_t n, FILE *stream)
+{
+    size_t i;
+    errno = 0;
+    i = fread(ptr, size, n, stream);
+    if ((i < n) && (errno == EPIPE)) {
+	clearerr(stream);
+	stream->flags |= _F_EOF;
+    }
+    return i;
+}
+#endif
 
 struct asynchronous_arg_t {
     /* output field */


In This Thread

Prev Next