diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-02-24 17:51:02 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-02-24 17:51:02 +0000 |
commit | f930fc33ddc1e30b5b2fc3d70f16fc4d3d567ac2 (patch) | |
tree | f0112c6fc162bf3aa68e715b5dbf60035dfc2328 /file.c | |
parent | e5c14ce5007bea9785fd68fab0fd8c4bd9bd4777 (diff) |
* file.c (rb_file_s_rename): avoid Cygwin's bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1170,8 +1170,13 @@ rb_file_s_rename(obj, from, to) Check_SafeStr(from); 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); + } return INT2FIX(0); } |