mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
18af42d5a4
commit
87234557eb
1 changed files with 5 additions and 1 deletions
6
mjit.c
6
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 *
|
||||
|
|
Loading…
Add table
Reference in a new issue