summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 2db69b939e4..13775950507 100644
--- a/io.c
+++ b/io.c
@@ -2371,7 +2371,7 @@ io_reopen(io, nfile)
mode = rb_io_mode_string(fptr);
fd = fileno(fptr->f);
- if (fd == fileno(stdin) || fd == fileno(stdout) || fd == fileno(stderr)) {
+ if (fptr->f == stdin || fptr->f == stdout || fptr->f == stderr) {
clearerr(fptr->f);
/* need to keep stdio objects */
if (dup2(fileno(orig->f), fd) < 0)