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

ruby-changes:39607

From: nobu <ko1@a...>
Date: Wed, 26 Aug 2015 15:53:48 +0900 (JST)
Subject: [ruby-changes:39607] nobu:r51688 (trunk): win32.c: ELOOP by _wopen

nobu	2015-08-26 15:53:32 +0900 (Wed, 26 Aug 2015)

  New Revision: 51688

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

  Log:
    win32.c: ELOOP by _wopen
    
    * win32/win32.c (rb_w32_wopen): map the exact error for ELOOP when
      EINVAL is returned by _wopen of vc runtime.

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 51687)
+++ win32/win32.c	(revision 51688)
@@ -5970,7 +5970,16 @@ rb_w32_wopen(const WCHAR *file, int ofla https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5970
 	pmode = va_arg(arg, int);
 	va_end(arg);
 	fd = _wopen(file, oflag, pmode);
-	if (fd == -1 && errno == EACCES) check_if_wdir(file);
+	if (fd == -1) {
+	    switch (errno) {
+	      case EACCES:
+		check_if_wdir(file);
+		break;
+	      case EINVAL:
+		errno = map_errno(GetLastError());
+		break;
+	    }
+	}
 	return fd;
     }
 

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

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