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

ruby-changes:27299

From: kosaki <ko1@a...>
Date: Thu, 21 Feb 2013 13:41:37 +0900 (JST)
Subject: [ruby-changes:27299] kosaki:r39351 (trunk): * file.c (access_internal): removed.

kosaki	2013-02-21 13:41:23 +0900 (Thu, 21 Feb 2013)

  New Revision: 39351

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

  Log:
    * file.c (access_internal): removed.
    * file.c (rb_file_readable_real): use access() instead of
      access_internal().
    * file.c (rb_file_writable_real): ditto.
    * file.c (rb_file_executable_real): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/file.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39350)
+++ ChangeLog	(revision 39351)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Feb 21 13:15:40 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* file.c (access_internal): removed.
+	* file.c (rb_file_readable_real): use access() instead of
+	  access_internal().
+	* file.c (rb_file_writable_real): ditto.
+	* file.c (rb_file_executable_real): ditto.
+
 Thu Feb 21 13:04:59 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* file.c (eaccess): use access() when not using setuid nor setgid.
Index: file.c
===================================================================
--- file.c	(revision 39350)
+++ file.c	(revision 39351)
@@ -1113,12 +1113,6 @@ eaccess(const char *path, int mode) https://github.com/ruby/ruby/blob/trunk/file.c#L1113
 }
 #endif
 
-static inline int
-access_internal(const char *path, int mode)
-{
-    return access(path, mode);
-}
-
 
 /*
  * Document-class: FileTest
@@ -1350,7 +1344,7 @@ rb_file_readable_real_p(VALUE obj, VALUE https://github.com/ruby/ruby/blob/trunk/file.c#L1344
     rb_secure(2);
     FilePathValue(fname);
     fname = rb_str_encode_ospath(fname);
-    if (access_internal(StringValueCStr(fname), R_OK) < 0) return Qfalse;
+    if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse;
     return Qtrue;
 }
 
@@ -1422,7 +1416,7 @@ rb_file_writable_real_p(VALUE obj, VALUE https://github.com/ruby/ruby/blob/trunk/file.c#L1416
     rb_secure(2);
     FilePathValue(fname);
     fname = rb_str_encode_ospath(fname);
-    if (access_internal(StringValueCStr(fname), W_OK) < 0) return Qfalse;
+    if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse;
     return Qtrue;
 }
 
@@ -1486,7 +1480,7 @@ rb_file_executable_real_p(VALUE obj, VAL https://github.com/ruby/ruby/blob/trunk/file.c#L1480
     rb_secure(2);
     FilePathValue(fname);
     fname = rb_str_encode_ospath(fname);
-    if (access_internal(StringValueCStr(fname), X_OK) < 0) return Qfalse;
+    if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse;
     return Qtrue;
 }
 

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

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