Ilya Zakharevich on Sat, 22 May 1999 14:31:16 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: 2.0.15: Problems


	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" */