[前][次][番号順一覧][スレッド一覧]

ruby-changes:37089

From: nobu <ko1@a...>
Date: Wed, 7 Jan 2015 19:19:33 +0900 (JST)
Subject: [ruby-changes:37089] nobu:r49170 (trunk): dir.c: cifs symlinkd on OSX

nobu	2015-01-07 19:19:29 +0900 (Wed, 07 Jan 2015)

  New Revision: 49170

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49170

  Log:
    dir.c: cifs symlinkd on OSX
    
    * dir.c (dir_initialize): workaround of opendir failure at symlink
      directories on Windows via CIFS.

  Modified files:
    trunk/ChangeLog
    trunk/dir.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49169)
+++ ChangeLog	(revision 49170)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jan  7 19:19:26 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
Index: dir.c
===================================================================
--- dir.c	(revision 49169)
+++ dir.c	(revision 49170)
@@ -480,6 +480,15 @@ dir_initialize(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/dir.c#L480
 	    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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]