summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-06 00:19:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-06 00:19:23 +0000
commit941621946feaecf6e53f9e10b487c3bd04886f0b (patch)
tree5aefb413cf76c77d59caf26727312cce19138e31 /io.c
parente0aaf5f5ca8e10173da20389827f304bf60c1c09 (diff)
io.c: use RB_INTEGER_TYPE_P
* io.c (fptr_finalize): use dedicated macro RB_INTEGER_TYPE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/io.c b/io.c
index e50d0d07a0..e9ff6f5ff9 100644
--- a/io.c
+++ b/io.c
@@ -4292,14 +4292,10 @@ fptr_finalize(rb_io_t *fptr, int noraise)
}
if (!NIL_P(err) && !noraise) {
- switch (TYPE(err)) {
- case T_FIXNUM:
- case T_BIGNUM:
+ if (RB_INTEGER_TYPE_P(err))
rb_syserr_fail_path(NUM2INT(err), fptr->pathv);
-
- default:
- rb_exc_raise(err);
- }
+ else
+ rb_exc_raise(err);
}
free_io_buffer(&fptr->rbuf);
free_io_buffer(&fptr->wbuf);