mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* file.c (rb_file_s_rename): avoid Cygwin's bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9ce5d1f0f5
commit
f3d7d9fe48
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sun Feb 25 02:45:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_file_s_rename): avoid Cygwin's bug.
|
||||||
|
|
||||||
Sat Feb 24 22:14:00 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
Sat Feb 24 22:14:00 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (myrename): fix error handling.
|
* win32/win32.c (myrename): fix error handling.
|
||||||
|
|
7
file.c
7
file.c
|
@ -1252,8 +1252,13 @@ rb_file_s_rename(obj, from, to)
|
||||||
Check_SafeStr(from);
|
Check_SafeStr(from);
|
||||||
Check_SafeStr(to);
|
Check_SafeStr(to);
|
||||||
|
|
||||||
if (rename(RSTRING(from)->ptr, RSTRING(to)->ptr) < 0)
|
if (rename(RSTRING(from)->ptr, RSTRING(to)->ptr) < 0) {
|
||||||
|
#if defined __CYGWIN__
|
||||||
|
extern unsigned long __attribute__((stdcall)) GetLastError();
|
||||||
|
errno = GetLastError(); /* This is a Cygwin bug */
|
||||||
|
#endif
|
||||||
rb_sys_fail(RSTRING(from)->ptr);
|
rb_sys_fail(RSTRING(from)->ptr);
|
||||||
|
}
|
||||||
|
|
||||||
return INT2FIX(0);
|
return INT2FIX(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue