aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
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 292e9b8b82..e8b20afd24 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);