From 87234557eb1646dca38a5be885b786658f7bd9e8 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 20 Feb 2018 07:51:22 +0000 Subject: mjit.c: fix compile error * mjit.c (check_tmpdir): W_OK and S_ISDIR may not defined on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 935f041a33..a64a56b3a6 100644 --- a/mjit.c +++ b/mjit.c @@ -1268,6 +1268,9 @@ check_tmpdir(const char *dir) if (!dir) return FALSE; if (stat(dir, &st)) return FALSE; +#ifndef S_ISDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif if (!S_ISDIR(st.st_mode)) return FALSE; #ifndef _WIN32 # ifndef S_IWOTH @@ -1280,8 +1283,9 @@ check_tmpdir(const char *dir) return FALSE; # endif } + if (access(dir, W_OK)) return FALSE; #endif - return access(dir, W_OK) == 0; + return TRUE; } static char * -- cgit v1.2.3