aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-21 07:40:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-21 07:40:48 +0000
commit87265028dd71d12c1c0a2b002ba50ddc3dc55eb0 (patch)
tree65b6c8b8e1ab419152389f7397c4d00bfb1fe0a3 /dir.c
parentc4e2f4ade09a1f02fe5965b8efdb6f26f05ad4bf (diff)
downloadruby-87265028dd71d12c1c0a2b002ba50ddc3dc55eb0.tar.gz
dir.c: inline to_be_ignored
* dir.c (to_be_ignored): make an inline function to get rid of multiple errno function calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 737470c4bc..92b795fbf5 100644
--- a/dir.c
+++ b/dir.c
@@ -1233,7 +1233,12 @@ sys_enc_warning_in(const char *func, const char *mesg, rb_encoding *enc)
* ENOTDIR can be returned by stat(2) if a non-leaf element of the path
* is not a directory.
*/
-#define to_be_ignored(e) ((e) == ENOENT || (e) == ENOTDIR)
+ALWAYS_INLINE(static inline int to_be_ignored(int e));
+static inline int
+to_be_ignored(int e)
+{
+ return e == ENOENT || e == ENOTDIR;
+}
#ifdef _WIN32
#define STAT(p, s) rb_w32_ustati64((p), (s))