[#23677] linux-gnu — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
15 messages
2004/06/10
[#23679] Re: linux-gnu
— "Akinori MUSHA" <knu@...>
2004/06/10
At Thu, 10 Jun 2004 23:24:04 +0900,
[#23680] Re: linux-gnu
— akira yamada / やまだあきら <akira@...>
2004/06/10
[#23681] Re: linux-gnu
— "Akinori MUSHA" <knu@...>
2004/06/11
At Fri, 11 Jun 2004 04:38:00 +0900,
[#23682] Re: linux-gnu
— matz@... (Yukihiro Matsumoto)
2004/06/11
まつもと ゆきひろです
[#23683] Re: linux-gnu
— WATANABE Hirofumi <eban@...>
2004/06/11
わたなべです。
[#23690] singleton class inherits the object's class. — nobu.nakada@...
なかだです。
2 messages
2004/06/15
[#23693] Shell.Application on WIN32OLE — Masahiro Kitajima <katonbo@...>
かとんぼです。
7 messages
2004/06/16
[#23694] WIN32OLEの日本語エラーメッセージが切り詰められる — Masahiro Kitajima <katonbo@...>
かとんぼです。
5 messages
2004/06/16
[#23697] define_method and $SAFE — nobu.nakada@...
なかだです。
9 messages
2004/06/16
[#23705] Re: define_method and $SAFE
— matz@... (Yukihiro Matsumoto)
2004/06/17
まつもと ゆきひろです
[#23706] Re: define_method and $SAFE
— nobu.nakada@...
2004/06/17
なかだです。
[#23700] Oniguruma segfaults on matching at long line? — nobu.nakada@...
なかだです。
1 message
2004/06/16
[#23704] [mswin32] printf の NaN, Inf 表示 — Masahiro Kitajima <katonbo@...>
かとんぼです。
5 messages
2004/06/17
[#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
山本です。
[#23725] Re: error at TestDRbMServer (test/drb)
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2004/06/19
山本です。
[#23726] Re: error at TestDRbMServer (test/drb)
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2004/06/19
山本です。
[#23727] Re: error at TestDRbMServer (test/drb)
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2004/06/19
山本です。
[#23728] Re: error at TestDRbMServer (test/drb)
— "U.Nakamura" <usa@...>
2004/06/21
こんにちは、なかむら(う)です。
[#23729] Re: error at TestDRbMServer (test/drb)
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2004/06/21
山本です。
[#23733] Re: error at TestDRbMServer (test/drb)
— nobu.nakada@...
2004/06/21
なかだです。
[#23734] Re: error at TestDRbMServer (test/drb)
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2004/06/21
山本です。
[#23730] Re test/ruby/test_pipe.rb fails in bcc32 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
5 messages
2004/06/21
[#23762] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
40 messages
2004/06/23
[#23778] Re: Ruby 1.8.2 to be released.
— Kouhei Sutou <kou@...>
2004/06/24
須藤です.
[#23779] Re: Ruby 1.8.2 to be released.
— Kazuhiro NISHIYAMA <zn@...>
2004/06/24
西山和広です。
[#23795] Re: Ruby 1.8.2 to be released.
— matz@... (Yukihiro Matsumoto)
2004/06/25
まつもと ゆきひろです
[#23781] Thread critical でも timeout を使いたい — Tatsuki Sugiura <sugi@...>
杉浦と申します。こんにちは。
11 messages
2004/06/24
[#23782] Re: Thread critical でも timeout を使いたい
— matz@... (Yukihiro Matsumoto)
2004/06/24
まつもと ゆきひろです
[#23783] Re: Thread critical でも timeout を使いたい
— Tatsuki Sugiura <sugi@...>
2004/06/25
杉浦です。
[#23801] Re: Thread critical でも timeout を使いたい
— Tatsuki Sugiura <sugi@...>
2004/06/25
杉浦です。
[#23784] URI() — Tanaka Akira <akr@...17n.org>
前から思っていたのですが、URI.parse("http://...") を URI("http://...")
19 messages
2004/06/25
[#23786] Re: URI()
— MoonWolf <moonwolf@...>
2004/06/25
MoonWolfです。
[#23788] Re: URI()
— matz@... (Yukihiro Matsumoto)
2004/06/25
まつもと ゆきひろです
[#23789] Re: URI()
— MoonWolf <moonwolf@...>
2004/06/25
Yukihiro Matsumoto wrote:
[#23790] Re: URI()
— matz@... (Yukihiro Matsumoto)
2004/06/25
まつもと ゆきひろです
[#23791] Re: URI()
— MoonWolf <moonwolf@...>
2004/06/25
Yukihiro Matsumoto wrote:
[#23794] Re: URI()
— matz@... (Yukihiro Matsumoto)
2004/06/25
まつもと ゆきひろです
[#23796] Re: URI()
— MoonWolf <moonwolf@...>
2004/06/25
Yukihiro Matsumoto wrote:
[#23815] set_trace_func in safe mode — nobu.nakada@...
なかだです。
5 messages
2004/06/26
[ruby-dev:23743] Re: error at TestDRbMServer (test/drb)
From:
"H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date:
2004-06-22 03:45:40 UTC
List:
ruby-dev #23743
山本です。
一番肝心な ___topen という関数が「未定義です」というエラーになってしまって、うまくいき
ませんでした。
しかたないので、EINVAL にも対処してお茶を濁しました。その他の fp == NULL && errno == 0
のケースはほぼ ENOMEM なのですが、fp->token != fp のときなど、バリデーションチェックに
も使われているので、念のため保留しました。
Index: lib/drb/drb.rb
===================================================================
RCS file: /var/cvs/src/ruby/lib/drb/drb.rb,v
retrieving revision 1.19
diff -u -w -b -p -r1.19 drb.rb
--- lib/drb/drb.rb 16 May 2004 15:09:52 -0000 1.19
+++ lib/drb/drb.rb 22 Jun 2004 03:09:29 -0000
@@ -702,6 +702,8 @@ module DRb
rescue DRbBadScheme
rescue DRbConnError
raise($!)
+ rescue Errno::ENFILE, Errno::EMFILE
+ raise($!)
rescue
raise(DRbConnError, "#{uri} - #{$!.inspect}")
end
@@ -1075,16 +1077,29 @@ module DRb
@pool = new_pool
end
- conn = self.new(remote_uri) unless conn
+ until conn
+ begin
+ conn = self.new(remote_uri)
+ rescue Errno::ENFILE, Errno::EMFILE
+ @mutex.synchronize do
+ raise(DRbConnError, "#{remote_uri} - #{$!.inspect}") if @pool.empty?
+ @pool.pop.close
+ end
+ end
+ end
+
succ, result = yield(conn)
return succ, result
ensure
+ if conn
@mutex.synchronize do
- if @pool.size > POOL_SIZE or ! succ
- conn.close if conn
- else
+ if succ
@pool.unshift(conn)
+ @pool.pop.close while @pool.size > POOL_SIZE
+ else
+ conn.close
+ end
end
end
end
Index: win32/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/win32.c 21 Jun 2004 00:27:39 -0000 1.117
+++ win32/win32.c 22 Jun 2004 02:46:40 -0000
@@ -2726,6 +2726,89 @@ isUNCRoot(const char *path)
}
#ifdef __BORLANDC__
+static int
+too_many_files(void)
+{
+ register FILE *fp;
+ for (fp = _streams; fp < _streams + _nfile; fp++)
+ if (fp->fd < 0) return 0;
+ return 1;
+}
+static int
+invalid_type(register const char *type)
+{
+ switch (*type++) {
+ case 'r':
+ case 'w':
+ case 'a':
+ break;
+ default:
+ return 1;
+ }
+ if (*type == '+') type++;
+ switch (*type) {
+ case 't':
+ case 'b':
+ case '+':
+ case '\0':
+ return 0;
+ default:
+ return 1;
+ }
+}
+#undef fopen
+FILE *
+rb_w32_fopen(const char *path, const char *type)
+{
+ if (too_many_files()) {
+ errno = EMFILE;
+ return NULL;
+ }
+ else if (invalid_type(type)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ else {
+ errno = 0;
+ return fopen(path, type);
+ }
+}
+FILE *
+rb_w32_fdopen(int handle, char *type)
+{
+ if (handle < 0) {
+ errno = EBADF;
+ return NULL;
+ }
+ else if (too_many_files()) {
+ errno = EMFILE;
+ return NULL;
+ }
+ else if (invalid_type(type)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ else {
+ errno = 0;
+ return _fdopen(handle, type);
+ }
+}
+FILE *
+rb_w32_fsopen(const char *path, const char *type, int shflag)
+{
+ if (too_many_files()) {
+ errno = EMFILE;
+ return NULL;
+ }
+ else if (invalid_type(type)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ else {
+ errno = 0;
+ return _fsopen(path, type, shflag);
+ }
+}
#undef fstat
int
rb_w32_fstat(int fd, struct stat *st)
@@ -3034,10 +3117,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 +3152,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 */
Index: win32/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/win32.h 19 Feb 2004 09:08:23 -0000 1.51
+++ win32/win32.h 21 Jun 2004 16:44:57 -0000
@@ -115,6 +115,16 @@ extern "C++" {
#define sopen _sopen
#undef fstat
#define fstat(fd,st) rb_w32_fstat(fd,st)
+#undef fopen
+#define fopen(p, t) rb_w32_fopen(p, t)
+#undef fdopen
+#define fdopen(h, t) rb_w32_fdopen(h, t)
+#undef fsopen
+#define fsopen(p, t, f) rb_w32_fsopen(p, t, f)
+#endif
+#if defined __BORLANDC__ || defined _WIN32_WCE
+#undef fread
+#define fread(p, m, n, stream) rb_w32_fread(p, m, n, stream)
#endif
#define fsync(h) _commit(h)
#undef stat
@@ -178,6 +188,15 @@ extern int rb_w32_spawn(int, const char
extern int rb_w32_aspawn(int, const char *, char *const *);
extern int kill(int, int);
extern pid_t rb_w32_getpid(void);
+#ifdef __BORLANDC__
+extern int rb_w32_fstat(int fd, struct stat *st);
+extern FILE *rb_w32_fopen(const char *path, const char *type);
+extern FILE *rb_w32_fdopen(int handle, char *type);
+extern FILE *rb_w32_fsopen(const char *path, const char *type, int shflag);
+#endif
+#if defined __BORLANDC__ || defined _WIN32_WCE
+extern size_t rb_w32_fread(void *ptr, size_t size, size_t n, FILE *stream);
+#endif
#include <float.h>
#if !defined __MINGW32__ || defined __NO_ISOCEXT