summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 00:21:03 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 00:21:03 +0000
commit698f6648c5e560c77c2a3c4c3a142ac47eef0a59 (patch)
treef97359cbcf4592c7945a19f5c24407d8b011854d /ruby.c
parentff132bc0f46cf505ee70e17e9948b5288e704d28 (diff)
* ruby.c (open_load_file): use rb_thread_wait_fd() instead of reopen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/ruby.c b/ruby.c
index 8457bea19a..5b92d498e6 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1726,19 +1726,6 @@ load_file_internal(VALUE argp_v)
return (VALUE)tree;
}
-#ifdef S_ISFIFO
-static void *
-loadopen_func(void *arg)
-{
- int fd;
- fd = rb_cloexec_open((const char *)arg, O_RDONLY, 0);
- if (fd >= 0)
- rb_update_max_fd(fd);
-
- return (void *)(VALUE)fd;
-}
-#endif
-
static VALUE
open_load_file(VALUE fname_v, int *xflag)
{
@@ -1793,12 +1780,7 @@ open_load_file(VALUE fname_v, int *xflag)
rb_load_fail(fname_v, strerror(e));
}
if (S_ISFIFO(st.st_mode)) {
- /* We need to wait if FIFO is empty. So, let's reopen it. */
- (void)close(fd);
- fd = (int)(VALUE)rb_thread_call_without_gvl(loadopen_func,
- (void *)fname, RUBY_UBF_IO, 0);
- if (fd < 0)
- rb_load_fail(fname_v, strerror(errno));
+ rb_thread_wait_fd(fd);
}
}
#endif