summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/io.c b/io.c
index 9abffb95195..43338dd274a 100644
--- a/io.c
+++ b/io.c
@@ -1475,13 +1475,16 @@ pipe_finalize(fptr)
OpenFile *fptr;
{
#if !defined (__CYGWIN__)
+ extern VALUE rb_last_status;
+ int status;
if (fptr->f) {
- pclose(fptr->f);
+ status = pclose(fptr->f);
}
if (fptr->f2) {
- pclose(fptr->f2);
+ status = pclose(fptr->f2);
}
fptr->f = fptr->f2 = 0;
+ rb_last_status = INT2FIX(status);
#else
fptr_finalize(fptr);
#endif