summaryrefslogtreecommitdiffhomepage
path: root/src/io.c
diff options
context:
space:
mode:
authorksss <[email protected]>2017-05-21 22:54:46 +0900
committerksss <[email protected]>2017-05-21 22:54:46 +0900
commit86edc9ab8541d15b470dd4fe0bac1e136c2ffced (patch)
treed7d70ed2e48db790148de1a889b170c221228a1d /src/io.c
parent844b2c368fc4bf852ea1a5f24731ae4bdd6b2331 (diff)
downloadmruby-86edc9ab8541d15b470dd4fe0bac1e136c2ffced.tar.gz
mruby-86edc9ab8541d15b470dd4fe0bac1e136c2ffced.zip
IO#sysread should raise IOError when closed
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index 2a24b18a4..f15f182f2 100644
--- a/src/io.c
+++ b/src/io.c
@@ -636,7 +636,7 @@ mrb_io_sysread(mrb_state *mrb, mrb_value io)
buf = mrb_str_resize(mrb, buf, maxlen);
}
- fptr = (struct mrb_io *)mrb_get_datatype(mrb, io, &mrb_io_type);
+ fptr = (struct mrb_io *)io_get_open_fptr(mrb, io);
ret = read(fptr->fd, RSTRING_PTR(buf), maxlen);
switch (ret) {
case 0: /* EOF */