aboutsummaryrefslogtreecommitdiffstats
path: root/ext/io
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-23 08:57:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-23 08:57:48 +0000
commitb8fff7a8fb3669e86c2547119dc34e375b098325 (patch)
tree54a609327994753d5579a07797f199fff86c3dc4 /ext/io
parent4542c5d55399b06226fb983452fe3df86931fad8 (diff)
downloadruby-b8fff7a8fb3669e86c2547119dc34e375b098325.tar.gz
prefer rb_syserr_fail
* file.c, io.c, util.c: prefer rb_syserr_fail with saved errno over setting errno then call rb_sys_fail, not to be clobbered potentially and to reduce thread local errno accesses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/io')
-rw-r--r--ext/io/console/console.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 94669307c6..fd3f03b6b4 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -280,8 +280,7 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void
}
if (status) {
if (status == -1) {
- errno = error;
- rb_sys_fail(0);
+ rb_syserr_fail(error, 0);
}
rb_jump_tag(status);
}