diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-20 05:33:00 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-20 05:33:00 +0000 |
commit | 3569ef534cbac13eec8c6ef10fe4a258ff2e0002 (patch) | |
tree | 2ab2c6f69c1182b19577ea1a35807a220258a71f /dir.c | |
parent | a8018aa415a446e6bf711f14a34acdc099e90487 (diff) |
merge revision(s) 49170:
* dir.c (dir_initialize): workaround of opendir failure at symlink
directories on Windows via CIFS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -480,6 +480,15 @@ dir_initialize(int argc, VALUE *argv, VALUE dir) rb_gc(); dp->dir = opendir(path); } +#ifdef HAVE_GETATTRLIST + else if (errno == EIO) { + u_int32_t attrbuf[1]; + struct attrlist al = {ATTR_BIT_MAP_COUNT, 0}; + if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW) == 0) { + dp->dir = opendir(path); + } + } +#endif if (dp->dir == NULL) { RB_GC_GUARD(dirname); rb_sys_fail_path(orig); |