summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-16 06:54:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-16 06:54:38 +0000
commitabf832f4357b02ab40a1bbcb6e59bbc1c35d2817 (patch)
treeaf6cb33b4cea4c9cbfae9bbd3149f115103d4b0e /ruby.c
parent6291c6ad77a0587d3d7d5461d969f1bc9bbe866d (diff)
file.c: non-blocking open
* file.c (rb_file_load_ok): open in non-blocking mode withoout releasing GVL. don't care about others than regular files and directories. [ruby-dev:49272] [Bug #11559] * ruby.c (load_file_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index 2d4c64b..6899ac2 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1739,6 +1739,11 @@ load_file_internal(VALUE arg)
}
else {
int fd, mode = O_RDONLY;
+#if defined O_NONBLOCK
+ mode |= O_NONBLOCK;
+#elif defined O_NDELAY
+ mod |= O_NDELAY;
+#endif
#if defined DOSISH || defined __CYGWIN__
{
const char *ext = strrchr(fname, '.');