summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
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 bde78f17f3..2f3e9409ca 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);