summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-17 23:41:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-17 23:41:14 (GMT)
commitd6379666cad4bda4e147b9f9bb2d07a80a1a3aa9 (patch)
tree0b0ce992288bef0ed0533a167686d8ae7518d217 /ruby.c
parentd5cb997f18ad94969043d7847c7e22cef2483eca (diff)
file.c: set errno
* file.c (ruby_is_fd_loadable): set proper errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index bde78f1..2f3e940 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1803,8 +1803,9 @@ open_load_file(VALUE fname_v, int *xflag)
}
#endif
if (!ruby_is_fd_loadable(fd)) {
+ int e = errno;
(void)close(fd);
- rb_load_fail(fname_v, strerror(errno));
+ rb_load_fail(fname_v, strerror(e));
}
f = rb_io_fdopen(fd, mode, fname);