Skip to content

Commit d40fa59

Browse files
committed
The descriptor of an IO is never set to -2, remove dead code
1 parent 2ca0ff0 commit d40fa59

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/org/truffleruby/core/support/IONodes.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,10 @@ public DynamicObject ensureOpen(DynamicObject file,
396396
if (fd == CLOSED_FD) {
397397
errorProfile.enter();
398398
throw new RaiseException(getContext(), coreExceptions().ioError("closed stream", this));
399-
} else if (fd == -2) {
400-
errorProfile.enter();
401-
throw new RaiseException(getContext(), coreExceptions().ioError("shutdown stream", this));
399+
} else {
400+
assert fd >= 0;
401+
return nil();
402402
}
403-
return nil();
404403
}
405404

406405
}

0 commit comments

Comments
 (0)