This is the only working solution, unless we move the other
function to a separate function inside Harbour source tree.
I'll do that.


Probably, it isn't needed. I added the modified errint.c to letodb sources, it looks now like the following ( without headers ):

static BOOL   bErrHandlerRun = 0;
extern leto_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 );

void hb_errInternalRaw( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{

   if( szPar1 == NULL )
      szPar1 = "";

   if( szPar2 == NULL )
      szPar2 = "";

   if( !bErrHandlerRun )
   {
      bErrHandlerRun = 1;
      leto_errInternal( ulIntCode, szText, szPar1, szPar2 );
   }
   else
   {
      FILE * hLog;
      hLog = hb_fopen( "letodb_crash.log", "a+" );

      if( hLog )
      {
         fprintf( hLog, "Unrecoverable error %lu: ", ulIntCode );
         if( szText )
            fprintf( hLog, "%s %s %s\n", szText, szPar1, szPar2 );
         fclose( hLog );
      }
   }

}

void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{
   hb_errInternalRaw( ulIntCode, szText, szPar1, szPar2 );

   /* release console settings */
   hb_conRelease();

   if( hb_cmdargCheck( "ERRGPF" ) )
   {
       int *pGPF = NULL;
       *pGPF = 0;
       *(--pGPF) = 0;
   }

   exit( EXIT_FAILURE );
}

bErrHandlerRun is used to prevent cycling if closing databases by leto_errInternal() will cause anouther internal error.

Quite strange, I've never seen that. Did you try to create letodb with
hbmk2? I would wonder if you'd get the same error. In case you do,
please post your MinGW version and -trace output.



 It's solved, as I just wrote.

Regards, ALexander.
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to