diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-21 04:41:23 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-21 04:41:23 +0000 |
commit | 1cda6e3968b7245b302b20898ac02db3a6289309 (patch) | |
tree | 4b16dca1fffbbf5ec8d7901fb1b17c8e1893a265 | |
parent | ba37db04533cec102212605488989c5d02bea67f (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | file.c | 12 |
2 files changed, 11 insertions, 9 deletions
@@ -1,3 +1,11 @@ +Thu Feb 21 13:15:40 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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@gmail.com> * file.c (eaccess): use access() when not using setuid nor setgid. @@ -1113,12 +1113,6 @@ eaccess(const char *path, int mode) } #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 fname) 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 fname) 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, VALUE fname) 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; } |