[#17876] cbase in module_eval {...} — Koji Arai <JCA02266@...>
新井です。
[#17881] Re: [ruby-list:35696] Re: サブクラスのオブジェクト生成時に、スーパークラスの初期化を行うには ? — nobu.nakada@...
なかだです。
なかだです。
At Fri, 2 Aug 2002 12:17:33 +0900,
まつもと ゆきひろです
At Sat, 3 Aug 2002 23:32:39 +0900,
まつもと ゆきひろです
At Sun, 4 Aug 2002 18:18:56 +0900,
[#17882] nested method, etc — Minero Aoki <aamine@...>
あおきです。
[#17885] Ruby Development Roadmap? — TAKAHASHI Masayoshi <maki@...>
高橋征義です。
まつもと ゆきひろです
[#17887] next parser (Re: parenthesize argument(s) for future version) — Minero Aoki <aamine@...>
あおきです。スレッド切ります。
まつもと ゆきひろです
あおきです。
まつもと ゆきひろです
あおきです。
まつもと ゆきひろです
まつもと ゆきひろです
あおきです。
まつもと ゆきひろです
[#17889] ruby-bugs-ja incoming/277 — Takaaki Tateishi <ttate@...>
立石です.
At Sat, 3 Aug 2002 05:13:32 +0900,
At Sat, 3 Aug 2002 05:53:29 +0900,
なかだです。
At Mon, 5 Aug 2002 19:15:25 +0900,
At Mon, 5 Aug 2002 22:11:55 +0900,
なかだです。
At Tue, 6 Aug 2002 18:06:06 +0900,
[#17927] Re: import-module (Re: Re: scope-in-state) — keiju@... (石塚圭樹)
けいじゅ@日本ラショナルソフトウェアです.
原です。
けいじゅ@日本ラショナルソフトウェアです.
原です。
けいじゅ@日本ラショナルソフトウェアです.
けいじゅ@日本ラショナルソフトウェアです.
原です。
けいじゅ@日本ラショナルソフトウェアです.
原です。
[#17954] Selection IPv4/IPv6 at TCPSocket — NISHI Takao <zophos@...9.com>
にし@おかやまです。
At Wed, 7 Aug 2002 13:23:37 +0900,
At Sun, 1 Sep 2002 03:31:01 +0900,
At Sun, 1 Sep 2002 04:00:33 +0900,
At Sun, 1 Sep 2002 12:37:05 +0900,
At Sun, 1 Sep 2002 13:00:46 +0900,
あおきです。
あづみです。
なひです。ruby-devな話じゃないので、続きがあればruby-list?
In article <002301c25224$bdbbffb0$85222fc0@sarion.co.jp>,
にし@おかやまです。
[#17965] inferior-ruby-mode and irb — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
なかだです。
けいじゅ@日本ラショナルソフトウェアです.
なかだです。
まつもと ゆきひろです
[#17966] Hash has default block? — Tanaka Akira <akr@...17n.org>
ふと、ひさしぶりに(一年ぶりくらい?) AMarshal に手を入れていて気になっ
Tanaka Akiraさんの<hvo8z3gnvr6.fsf@coulee.a02.aist.go.jp>から
In article <20020809121059.B6DC51560@helium.ruby-lang.org>,
Tanaka Akiraさんの<hvo65yknitf.fsf@coulee.a02.aist.go.jp>から
In article <20020812052018.C7F9B1671@helium.ruby-lang.org>,
まつもと ゆきひろです
まつもと ゆきひろです
Yukihiro Matsumotoさんの
In article <20020813075933.DBB611415@helium.ruby-lang.org>,
まつもと ゆきひろです
In article <1029229143.399680.2549.nullmailer@picachu.netlab.jp>,
In article <1029229143.399680.2549.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1029423141.763951.25373.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1029464034.601483.27585.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1029468386.308580.28125.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1029471721.083381.28488.nullmailer@picachu.netlab.jp>,
ふと気がついたんですが、core を出せるのは allocation framework のせい
けいじゅ@日本ラショナルソフトウェアです.
In article <200208201159.UAA19826.keiju@ishitsuka.com>,
[#17968] [PATCH] source file/line of Proc — nobu.nakada@...
なかだです。
まつもと ゆきひろです
新井です。
At Sat, 7 Sep 2002 20:23:46 +0900,
なかだです。
新井です。
At Sun, 8 Sep 2002 04:01:33 +0900,
[#17982] optimization module (Re: [ruby-list:35735] Re: tail recursion elimination) — Tanaka Akira <akr@...17n.org>
In article <200208101420.g7AEKSWN009284@smtp16.dti.ne.jp>,
At Mon, 12 Aug 2002 22:33:38 +0900,
In article <200208121403.g7CE3VWN022924@smtp16.dti.ne.jp>,
At Tue, 13 Aug 2002 12:27:32 +0900,
In article <200208130601.g7D61VWN014235@smtp16.dti.ne.jp>,
なかだです。
[#18038] Kernel::putc ignores $defout — Tietew <tietew-ml-ruby-dev@...>
Tietew です。
[#18052] [Bug] rb_thread_create sometimes returns 0 — Tietew <tietew-ml-ruby-dev@...>
Tietew です。
まつもと ゆきひろです
[#18074] source file name at -r option — nobu.nakada@...
なかだです。
なかだです。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
In article <1033179659.378897.17493.nullmailer@picachu.netlab.jp>,
なひです。
なかだです。
まつもと ゆきひろです
なかだです。
なひです。
[#18076] Win32 signal, process etc — nobu.nakada@...
なかだです。
こんにちは、なかむら(う)です。
なかだです。
なかだです。
[#18077] load/require from current directory — Minero Aoki <aamine@...>
あおきです。
[#18087] IO.read returns nil with empty file — Tanaka Akira <akr@...17n.org>
ふと、空ファイルに対して IO.read を使って nil が返ってきて驚きました。
[#18103] autoload patch for ruby-1.7 — "Yoshinori K. Okuji" <okuji@...>
[ruby-dev:16180]でトップレベル以外の定数についてもautoloadができるよう
あおきです。
At Sun, 1 Sep 2002 15:53:24 +0900,
なかだです。
あおきです。
まつもと ゆきひろです
あおきです。
まつもと ゆきひろです
なかだです。
あおきです。
[#18104] Shim with VC++5 — "U.Nakamura" <usa@...>
CVSにあるShimをVC++5でmakeしようとしたところ、いくつか問題に
なかだです。
こんにちは、なかむら(う)です。
なかだです。
こんにちは、なかむら(う)です。
[#18109] mkmf.rb and extmk.rb — WATANABE Hirofumi <eban@...>
わたなべです。
まつもと ゆきひろです
わたなべです。
まつもと ゆきひろです
わたなべです。
早坂@北陸先端です.
わたなべです。
早坂@北陸先端です.
わたなべです。
早坂@北陸先端です.
[ruby-dev:18080] Re: Win32 signal, process etc
なかだです。
At Mon, 26 Aug 2002 14:23:18 +0900,
U.Nakamura <usa@osb.att.ne.jp> wrote:
> > win32/win32.c:kill()でSIGINTとSIGKILLだけ処理していますが、
> > signal.cではSIGKILLが定義されていないため、実際には即値で指定し
> > ないと使えません。win32.cのSIGKILLの定義をsignal.cにもコピーす
> > るか、win32.hでsignal.hもインクルードしてそっちに持っていくかす
> > る必要があると思います。あるいは、SIGTERMはあるようなのでこれも
> > SIGKILLと同じ処理にするとか。
>
> win32.hに入れようと思って、そのまま忘れてました。
> 候補にないですが、win32.hじゃなくてrubysig.h(ですよね?)じゃ
> ないと何かまずいんでしたっけ?
そっちのほうがいいかも知れません。
> > もうひとつ、pipe_exec()では一旦stdin/stdoutにdupしてから
> > CreateProcess()してますが、なんとなくこれはCreateChild()と機能
> > 的に重複してるような気がします。
>
> pipe_exec()ではCreateProcess()じゃなくてCreateChild()を呼ん
> でるつもりですが、見間違え?
いや、だからこそ重複してるような気がするわけです。
> ただ、CreateChild()の後ろの三つの引数を結局どこでも使ってな
> くて意味がないというのは思います。
> pipe_exec()で使うような使い方のために用意したつもりだったよ
> うな気もするんですけどね。
です。それを使うとたぶんこんな感じ。
# DuplicateHandleしないとまずい?
Index: win32.c
===================================================================
RCS file: /cvs/ruby/src/ruby/win32/win32.c,v
retrieving revision 1.63
diff -u -2 -p -r1.63 win32.c
--- win32.c 20 Aug 2002 13:03:22 -0000 1.63
+++ win32.c 24 Aug 2002 14:18:02 -0000
@@ -85,4 +85,7 @@ static DWORD wait_events(HANDLE event, D
#ifndef __BORLANDC__
static int rb_w32_open_osfhandle(long osfhandle, int flags);
+#define open_osfhandle rb_w32_open_osfhandle
+#else
+#define open_osfhandle _open_osfhandle
#endif
@@ -440,11 +443,8 @@ pipe_exec(char *cmd, int mode, FILE **fp
HANDLE hReadIn, hReadOut;
HANDLE hWriteIn, hWriteOut;
- HANDLE hSavedStdIn, hSavedStdOut;
- HANDLE hDupInFile, hDupOutFile;
- HANDLE hCurProc;
SECURITY_ATTRIBUTES sa;
- BOOL fRet;
BOOL reading, writing;
- int fdin, fdout;
+ FILE *fr, *fw;
+ int fd;
int pipemode;
char modes[3];
@@ -454,5 +454,13 @@ pipe_exec(char *cmd, int mode, FILE **fp
writing = (mode & (O_WRONLY | O_RDWR)) ? TRUE : FALSE;
reading = ((mode & O_RDWR) || !writing) ? TRUE : FALSE;
- pipemode = (mode & O_BINARY) ? O_BINARY : O_TEXT;
+ if (mode & O_BINARY) {
+ pipemode = O_BINARY;
+ modes[1] = 'b';
+ modes[2] = '\0';
+ }
+ else {
+ pipemode = O_TEXT;
+ modes[1] = '\0';
+ }
sa.nLength = sizeof (SECURITY_ATTRIBUTES);
@@ -463,168 +471,67 @@ pipe_exec(char *cmd, int mode, FILE **fp
RUBY_CRITICAL(do {
ret = -1;
- hCurProc = GetCurrentProcess();
if (reading) {
- fRet = CreatePipe(&hReadIn, &hReadOut, &sa, 2048L);
- if (!fRet) {
+ if (!CreatePipe(&hReadIn, &hReadOut, &sa, 2048L)) {
errno = GetLastError();
break;
}
- hSavedStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- if (!SetStdHandle(STD_OUTPUT_HANDLE, hReadOut) ||
- !DuplicateHandle(hCurProc, hReadIn, hCurProc, &hDupInFile, 0,
- FALSE, DUPLICATE_SAME_ACCESS)) {
- errno = GetLastError();
- CloseHandle(hReadIn);
- CloseHandle(hReadOut);
- CloseHandle(hCurProc);
- break;
- }
- CloseHandle(hReadIn);
}
if (writing) {
- fRet = CreatePipe(&hWriteIn, &hWriteOut, &sa, 2048L);
- if (!fRet) {
+ if (!CreatePipe(&hWriteIn, &hWriteOut, &sa, 2048L)) {
errno = GetLastError();
if (reading) {
- CloseHandle(hDupInFile);
+ CloseHandle(hReadIn);
CloseHandle(hReadOut);
}
break;
}
- hSavedStdIn = GetStdHandle(STD_INPUT_HANDLE);
- if (!SetStdHandle(STD_INPUT_HANDLE, hWriteIn) ||
- !DuplicateHandle(hCurProc, hWriteOut, hCurProc, &hDupOutFile, 0,
- FALSE, DUPLICATE_SAME_ACCESS)) {
- errno = GetLastError();
- CloseHandle(hWriteIn);
- CloseHandle(hWriteOut);
- CloseHandle(hCurProc);
- if (reading) {
- CloseHandle(hDupInFile);
- CloseHandle(hReadOut);
- }
- break;
- }
- CloseHandle(hWriteOut);
}
- CloseHandle(hCurProc);
- ret = 0;
- } while (0));
- if (ret != 0) {
- return ret;
- }
- /* create child process */
- child = CreateChild(cmd, &sa, NULL, NULL, NULL);
- if (!child) {
- RUBY_CRITICAL({
- if (reading) {
- SetStdHandle(STD_OUTPUT_HANDLE, hSavedStdOut);
- CloseHandle(hReadOut);
- CloseHandle(hDupInFile);
- }
- if (writing) {
- SetStdHandle(STD_INPUT_HANDLE, hSavedStdIn);
- CloseHandle(hWriteIn);
- CloseHandle(hDupOutFile);
- }
- });
- return -1;
- }
+ /* create child process */
+ child = CreateChild(cmd, &sa, hWriteIn, hReadOut, NULL);
+ if (reading) CloseHandle(hReadOut);
+ if (writing) CloseHandle(hWriteIn);
+ if (!child) {
+ if (reading) CloseHandle(hReadIn);
+ if (writing) CloseHandle(hWriteOut);
+ break;
+ }
- /* restore STDIN/STDOUT */
- RUBY_CRITICAL(do {
- ret = -1;
if (reading) {
- if (!SetStdHandle(STD_OUTPUT_HANDLE, hSavedStdOut)) {
- errno = GetLastError();
+ fd = open_osfhandle((long)hReadIn, (_O_RDONLY | pipemode));
+ if (fd == -1) {
+ CloseHandle(hReadIn);
+ read_open_failed:
+ if (writing) CloseHandle(hWriteOut);
CloseChildHandle(child);
- CloseHandle(hReadOut);
- CloseHandle(hDupInFile);
- if (writing) {
- CloseHandle(hWriteIn);
- CloseHandle(hDupOutFile);
- }
break;
}
+ modes[0] = 'r';
+ if ((fr = (FILE *)fdopen(fd, modes)) == NULL) {
+ _close(fd);
+ goto read_open_failed;
+ }
}
if (writing) {
- if (!SetStdHandle(STD_INPUT_HANDLE, hSavedStdIn)) {
- errno = GetLastError();
+ fd = open_osfhandle((long)hWriteOut, (_O_WRONLY | pipemode));
+ if (fd == -1) {
+ CloseHandle(hWriteOut);
+ write_open_failed:
+ if (reading) fclose(fr);
CloseChildHandle(child);
- CloseHandle(hWriteIn);
- CloseHandle(hDupOutFile);
- if (reading) {
- CloseHandle(hReadOut);
- CloseHandle(hDupInFile);
- }
break;
}
- }
- ret = 0;
- } while (0));
- if (ret != 0) {
- return ret;
- }
-
- if (reading) {
-#ifdef __BORLANDC__
- fdin = _open_osfhandle((long)hDupInFile, (_O_RDONLY | pipemode));
-#else
- fdin = rb_w32_open_osfhandle((long)hDupInFile, (_O_RDONLY | pipemode));
-#endif
- CloseHandle(hReadOut);
- if (fdin == -1) {
- CloseHandle(hDupInFile);
- if (writing) {
- CloseHandle(hWriteIn);
- CloseHandle(hDupOutFile);
- }
- CloseChildHandle(child);
- return -1;
- }
- }
- if (writing) {
-#ifdef __BORLANDC__
- fdout = _open_osfhandle((long)hDupOutFile, (_O_WRONLY | pipemode));
-#else
- fdout = rb_w32_open_osfhandle((long)hDupOutFile,
- (_O_WRONLY | pipemode));
-#endif
- CloseHandle(hWriteIn);
- if (fdout == -1) {
- CloseHandle(hDupOutFile);
- if (reading) {
- _close(fdin);
- }
- CloseChildHandle(child);
- return -1;
- }
- }
-
- if (reading) {
- sprintf(modes, "r%s", pipemode == O_BINARY ? "b" : "");
- if ((*fpr = (FILE *)fdopen(fdin, modes)) == NULL) {
- _close(fdin);
- if (writing) {
- _close(fdout);
- }
- CloseChildHandle(child);
- return -1;
- }
- }
- if (writing) {
- sprintf(modes, "w%s", pipemode == O_BINARY ? "b" : "");
- if ((*fpw = (FILE *)fdopen(fdout, modes)) == NULL) {
- _close(fdout);
- if (reading) {
- fclose(*fpr);
+ modes[0] = 'w';
+ if ((fw = (FILE *)fdopen(fd, modes)) == NULL) {
+ _close(fd);
+ goto write_open_failed;
}
- CloseChildHandle(child);
- return -1;
}
- }
+ *fpr = fr;
+ *fpw = fw;
+ ret = child->pid;
+ } while (0));
- return child->pid;
+ return ret;
}
@@ -2031,9 +1938,5 @@ rb_w32_socket (int af, int type, int pro
//fprintf(stderr, "socket fail (%d)", WSAGetLastError());
}
-#ifdef __BORLANDC__
- return _open_osfhandle(s, O_RDWR|O_BINARY);
-#else
- return rb_w32_open_osfhandle(s, O_RDWR|O_BINARY);
-#endif
+ return open_osfhandle(s, O_RDWR|O_BINARY);
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦