From pari-dev-return-548-ilya=math.ohio-state.edu@list.cr.yp.to  Sat May 22 14:31:17 1999
Received: from muncher.math.uic.edu (muncher.math.uic.edu [131.193.178.181])
	by mathserv.mps.ohio-state.edu (8.9.2/8.9.2) with SMTP id OAA29732
	for <ilya@math.ohio-state.edu>; Sat, 22 May 1999 14:31:15 -0400 (EDT)
Received: (qmail 9917 invoked by uid 1002); 22 May 1999 18:30:52 -0000
Mailing-List: contact pari-dev-help@list.cr.yp.to; run by ezmlm
Delivered-To: mailing list pari-dev@list.cr.yp.to
Received: (qmail 7345 invoked from network); 22 May 1999 18:30:52 -0000
Received: from mathserv.mps.ohio-state.edu (128.146.111.31)
  by muncher.math.uic.edu with SMTP; 22 May 1999 18:30:52 -0000
Received: from monk.mps.ohio-state.edu (monk.mps.ohio-state.edu [128.146.111.52])
	by mathserv.mps.ohio-state.edu (8.9.2/8.9.2) with ESMTP id OAA29728;
	Sat, 22 May 1999 14:31:14 -0400 (EDT)
Received: (from ilya@localhost)
	by monk.mps.ohio-state.edu (8.9.2/8.9.2) id OAA15486;
	Sat, 22 May 1999 14:31:16 -0400 (EDT)
Date: Sat, 22 May 1999 14:31:16 -0400
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
To: Karim BELABAS <Karim.Belabas@math.u-psud.fr>
Cc: pari-dev@list.cr.yp.to
Subject: Re: 2.0.15: Problems
Message-ID: <19990522143116.A15463@monk.mps.ohio-state.edu>
Reply-To: Ilya Zakharevich <ilya@math.ohio-state.edu>
References: <199905221530.RAA12534@geo.math.u-psud.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.1i
In-Reply-To: <199905221530.RAA12534@geo.math.u-psud.fr>; from Karim BELABAS on Sat, May 22, 1999 at 05:30:55PM +0200
Status: RO
Content-Length: 1762
Lines: 47


	On Sat, May 22, 1999 at 05:30:55PM +0200, Karim BELABAS wrote:
> [Ilya: pari-dev-543]
> > Moreover, redirection of PARI error messages (via the replacable
> > handlers for printing an error line and for fflushing) does not work,
> > which breaks a build of Math::Pari Perl module.  Can somebody guess
> > which edit could cause the latter behaviour?
> 
> In what way does it "not work" ? The only modification I see pertaining to
> input/output is the unbuffering of logfile ouput (setbuf(0) added twice in
> gp.c), but that doesn't sound related.

Got it!  The order of die()ing and flush()ing was changed, so the
message was interpreted as a warning by Perl, and then the error
message was empty (since an exception was called after flush()ing, so
the error message was emptied already).

Enjoy,
Ilya

--- ./src/headers/paristio.h~	Thu May 20 13:05:11 1999
+++ ./src/headers/paristio.h	Sat May 22 14:10:56 1999
@@ -23,8 +23,9 @@ typedef struct entree {
 typedef struct PariOUT {
   void (*putch)(char);
   void (*puts)(char*);
-  void (*flush)();
-  void (*die)();
+  void (*flush)();	/* Finalize a report of a non fatal-error. */
+  void (*die)();	/* If not-NULL, should be called to finalize
+			   a report of a fatal error (no "\n" required). */
 } PariOUT;
 
 typedef struct pariFILE {
--- ./src/language/init.c~	Thu May 20 13:05:16 1999
+++ ./src/language/init.c	Sat May 22 14:05:42 1999
@@ -602,8 +602,8 @@ err_recover(long numerr)
 {
   pari_outfile=stdout; errfile=stderr;
   disable_dbg(-1);
-  fprintferr("\n"); flusherr();
-  if (pariErr->die) pariErr->die();
+  if (pariErr->die) pariErr->die();	/* Caller wants to catch exceptions? */
+  fprintferr("\n"); flusherr();
   if (!environnement) exit(1);
 
   /* reclaim memory stored in "blocs" */

