なかだです。

At Fri, 18 Aug 2006 09:52:59 +0900,
Beyond wrote in [ruby-dev:29293]:
> cygwinだけだと思いますが、次のようなスクリプトでcoreをはきます。
> 
> $ ruby mv.rb
> mv.rb:5: [BUG] rb_sys_fail(b or a) - errno == 0
> ruby 1.8.5 (2006-08-06) [i386-cygwin]
> 
> Aborted (core dumped)

どうやら、rename()でerrnoがセットされないというバグは、最近の
cygwinでは直っているようです。


Index: file.c =================================================================== RCS file: /pub/cvs/ruby/src/ruby/file.c,v retrieving revision 1.169.2.48 diff -U 2 -p -u -r1.169.2.48 file.c --- file.c 17 Aug 2006 10:15:55 -0000 1.169.2.48 +++ file.c 18 Aug 2006 03:45:56 -0000 @@ -2233,8 +2233,13 @@ rb_file_s_rename(klass, from, to) src = StringValueCStr(from); dst = StringValueCStr(to); +#if defined __CYGWIN__ + errno = 0; +#endif if (rename(src, dst) < 0) { #if defined __CYGWIN__ extern unsigned long __attribute__((stdcall)) GetLastError(void); - errno = GetLastError(); /* This is a Cygwin bug */ + if (errno == 0) { + errno = GetLastError(); /* This is a Cygwin bug */ + } #elif defined DOSISH && !defined _WIN32 if (errno == EEXIST
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦