summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-07 10:19:29 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-07 10:19:29 (GMT)
commit10e74f035f4c89246389de654f21a5f9b82ed95c (patch)
tree6bfef4e1817fcef1e35fc6a3555d6b8c8e3c6bb6 /dir.c
parent79219d96562e1254e725bb20f9e821459d40f0f8 (diff)
dir.c: cifs symlinkd on OSX
* 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/trunk@49170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 292e9b8..e8b20af 100644
--- a/dir.c
+++ b/dir.c
@@ -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);