1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

file.c: release GVL in File.{setuid?,setgid?,sticky?}

* file.c (check3rdbyte): use rb_stat to release GVL

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2017-10-03 23:47:29 +00:00
parent 5f6b04223f
commit 27cced701b

4
file.c
View file

@ -1883,9 +1883,7 @@ check3rdbyte(VALUE fname, int mode)
{
struct stat st;
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) < 0) return Qfalse;
if (rb_stat(fname, &st) < 0) return Qfalse;
if (st.st_mode & mode) return Qtrue;
return Qfalse;
}