diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-23 08:57:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-23 08:57:48 +0000 |
commit | b8fff7a8fb3669e86c2547119dc34e375b098325 (patch) | |
tree | 54a609327994753d5579a07797f199fff86c3dc4 /ext/openssl/ossl_bio.c | |
parent | 4542c5d55399b06226fb983452fe3df86931fad8 (diff) | |
download | ruby-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/openssl/ossl_bio.c')
-rw-r--r-- | ext/openssl/ossl_bio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/openssl/ossl_bio.c b/ext/openssl/ossl_bio.c index 7e3b3070da..cd2582646b 100644 --- a/ext/openssl/ossl_bio.c +++ b/ext/openssl/ossl_bio.c @@ -29,8 +29,9 @@ ossl_obj2bio(VALUE obj) } rb_update_max_fd(fd); if (!(fp = fdopen(fd, "r"))){ + int e = errno; close(fd); - rb_sys_fail(0); + rb_syserr_fail(e, 0); } if (!(bio = BIO_new_fp(fp, BIO_CLOSE))){ fclose(fp); |