summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 1e77e5b4ba..ec16438ffd 100644
--- a/io.c
+++ b/io.c
@@ -3172,6 +3172,7 @@ io_reopen(io, nfile)
}
else {
fclose(fptr->f);
+ fptr->f = NULL;
if (dup2(fd2, fd) < 0)
rb_sys_fail(orig->path);
fptr->f = rb_fdopen(fd, mode);