[m-dev.] diff: exceptions and buffered streams bug fix for cygwin

Peter Ross petdr at cs.mu.OZ.AU
Mon Jun 26 18:13:56 AEST 2000


Hi,


===================================================================


Estimated hours taken: 1

Fix a bug where under cygwin 'command 2>&1 > file', where command would
abort with a software error, would leave nothing in file even though
when run without redirection you would get the full output.

library/exception.m:
    Flush all the output streams, when reporting an uncaught exception.


Index: exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.24
diff -u -r1.24 exception.m
--- exception.m	2000/06/19 07:59:01	1.24
+++ exception.m	2000/06/26 08:03:45
@@ -1546,6 +1546,7 @@
 :- mode report_uncaught_exception_2(in, out, di, uo) is det.
 
 report_uncaught_exception_2(Exception, unit) -->
+	io__flush_output,
 	io__stderr_stream(StdErr),
 	io__write_string(StdErr, "Uncaught exception:\n"),
 	( { univ_to_type(Exception, software_error(Message)) } ->
@@ -1553,6 +1554,7 @@
 	;
 		io__write(StdErr, univ_value(Exception)),
 		io__nl(StdErr)
-	).
+	),
+	io__flush_output(StdErr).
 
 %-----------------------------------------------------------------------------%

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list