ruby-changes:14196
From: yugui <ko1@a...>
Date: Sat, 5 Dec 2009 18:49:10 +0900 (JST)
Subject: [ruby-changes:14196] Ruby:r26017 (ruby_1_9_1): merges r25092 from trunk into ruby_1_9_1.
yugui 2009-12-05 18:40:41 +0900 (Sat, 05 Dec 2009) New Revision: 26017 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26017 Log: merges r25092 from trunk into ruby_1_9_1. -- * win32/win32.c, include/ruby/win32.h (rb_w32_access): new function to replace MSVCRT's access(). [ruby-core:25761] * file.c (eaccess): workaround for recent MSVCRT is no longer needed. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/file.c branches/ruby_1_9_1/include/ruby/win32.h branches/ruby_1_9_1/version.h branches/ruby_1_9_1/win32/win32.c Index: ruby_1_9_1/include/ruby/win32.h =================================================================== --- ruby_1_9_1/include/ruby/win32.h (revision 26016) +++ ruby_1_9_1/include/ruby/win32.h (revision 26017) @@ -196,6 +196,7 @@ extern int rb_w32_stat(const char *, struct stat *); extern int rb_w32_fstat(int, struct stat *); #endif +#define access(path,mode) rb_w32_access(path,mode) #define strcasecmp stricmp #define strncasecmp strnicmp @@ -266,6 +267,7 @@ extern int rb_w32_rmdir(const char *); extern int rb_w32_unlink(const char *); extern int rb_w32_stati64(const char *, struct stati64 *); +extern int rb_w32_access(const char *, int); #ifdef __BORLANDC__ extern int rb_w32_fstati64(int, struct stati64 *); Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 26016) +++ ruby_1_9_1/ChangeLog (revision 26017) @@ -1,3 +1,11 @@ +Fri Sep 25 16:01:45 2009 NAKAMURA Usaku <usa@r...> + + * win32/win32.c, include/ruby/win32.h (rb_w32_access): new function to + replace MSVCRT's access(). + [ruby-core:25761] + + * file.c (eaccess): workaround for recent MSVCRT is no longer needed. + Mon Sep 28 19:36:20 2009 NAKAMURA Usaku <usa@r...> * win32/wini32.c (LK_ERR): with overlapped I/O, LockFileEx() returns Index: ruby_1_9_1/win32/win32.c =================================================================== --- ruby_1_9_1/win32/win32.c (revision 26016) +++ ruby_1_9_1/win32/win32.c (revision 26017) @@ -3648,6 +3648,20 @@ return ret; } +int +rb_w32_access(const char *path, int mode) +{ + struct stati64 stat; + if (rb_w32_stati64(path, &stat) != 0) + return -1; + mode <<= 6; + if ((stat.st_mode & mode) != mode) { + errno = EACCES; + return -1; + } + return 0; +} + static int rb_chsize(HANDLE h, off_t size) { Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 26016) +++ ruby_1_9_1/version.h (revision 26017) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 370 +#define RUBY_PATCHLEVEL 371 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_1/file.c =================================================================== --- ruby_1_9_1/file.c (revision 26016) +++ ruby_1_9_1/file.c (revision 26017) @@ -945,9 +945,6 @@ return -1; #else -# if defined(_MSC_VER) || defined(__MINGW32__) - mode &= ~1; -# endif return access(path, mode); #endif } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/