[svn:parrot] r46225 - trunk/src/interp
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Mon May 3 01:04:10 UTC 2010
Author: NotFound
Date: Mon May 3 01:04:10 2010
New Revision: 46225
URL: https://trac.parrot.org/parrot/changeset/46225
Log:
flush and unbuffer stderr and stdout at the start of interpreter destruction
Modified:
trunk/src/interp/inter_create.c
Modified: trunk/src/interp/inter_create.c
==============================================================================
--- trunk/src/interp/inter_create.c Sun May 2 23:47:33 2010 (r46224)
+++ trunk/src/interp/inter_create.c Mon May 3 01:04:10 2010 (r46225)
@@ -373,6 +373,15 @@
*/
Parrot_gc_completely_unblock(interp);
+ /* Set non buffered mode in standard out and err handles, flushing
+ * the buffers and avoiding pending output gets confused or lost in
+ * case of errors during destruction.
+ */
+ Parrot_io_setbuf(interp,
+ Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, NULL), PIOCTL_NONBUF);
+ Parrot_io_setbuf(interp,
+ Parrot_io_stdhandle(interp, PIO_STDERR_FILENO, NULL), PIOCTL_NONBUF);
+
if (Interp_trace_TEST(interp, ~0)) {
Parrot_io_eprintf(interp, "FileHandle objects (like stdout and stderr)"
"are about to be closed, so clearing trace flags.\n");
More information about the parrot-commits
mailing list