Author: allison
Date: Wed Nov 26 19:03:36 2008
New Revision: 33255
Modified:
branches/pdd22io_part2/src/pmc/filehandle.pmc
Log:
[pdd22io] Shared filehandles don't close the file descriptor when they're
destroyed, they just flush it.
Modified: branches/pdd22io_part2/src/pmc/filehandle.pmc
==============================================================================
--- branches/pdd22io_part2/src/pmc/filehandle.pmc (original)
+++ branches/pdd22io_part2/src/pmc/filehandle.pmc Wed Nov 26 19:03:36 2008
@@ -133,8 +133,12 @@
if (PARROT_FILEHANDLE(SELF)) {
Parrot_FileHandle_attributes *data_struct =
PARROT_FILEHANDLE(SELF);
- if (!Parrot_io_is_closed(INTERP, SELF))
- Parrot_io_close(INTERP, SELF);
+ if (!Parrot_io_is_closed(INTERP, SELF)) {
+ if (data_struct->flags & PIO_F_SHARED)
+ Parrot_io_flush(INTERP, SELF);
+ else
+ Parrot_io_close(INTERP, SELF);
+ }
if (data_struct->buffer_start)
mem_sys_free(data_struct->buffer_start);