summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-07 10:19:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-07 10:19:29 +0000
commit10e74f035f4c89246389de654f21a5f9b82ed95c (patch)
tree6bfef4e1817fcef1e35fc6a3555d6b8c8e3c6bb6
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
-rw-r--r--ChangeLog5
-rw-r--r--dir.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 59af0c7..da8fdd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 7 19:19:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_initialize): workaround of opendir failure at symlink
+ directories on Windows via CIFS.
+
Wed Jan 7 18:52:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
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);