aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/io.c b/io.c
index 8927fad927..e8007819b2 100644
--- a/io.c
+++ b/io.c
@@ -3029,14 +3029,8 @@ pipe_open(int argc, VALUE *argv, const char *mode)
/* parent */
if (pid == -1) {
int e = errno;
- if ((modef & FMODE_READABLE)) {
- close(arg.pair[0]);
- close(arg.pair[1]);
- }
- if ((modef & FMODE_WRITABLE)) {
- close(arg.pair[0]);
- close(arg.pair[1]);
- }
+ close(arg.pair[0]);
+ close(arg.pair[1]);
errno = e;
rb_sys_fail(cmd);
}