Branch: Tag:

1996-10-09

1996-10-09 02:01:32 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

exit_on_error fixed

Rev: src/backend.c:1.4
Rev: src/builtin_functions.c:1.7
Rev: src/error.c:1.5
Rev: src/error.h:1.4
Rev: src/main.c:1.8

15:   #undef ATTRIBUTE   #define ATTRIBUTE(X)    - char *automatic_fatal, *exit_on_error; +    JMP_BUF *recoveries=0;      JMP_BUF *init_recovery(JMP_BUF *r)
80:       VSPRINTF(buf, fmt, args);    -  if(automatic_fatal) +  if(!recoveries)    { -  fprintf(stderr,"%s %s",automatic_fatal,buf); -  abort(); -  } -  -  if(exit_on_error || !recoveries) -  { -  if(!exit_on_error) -  exit_on_error="No error recovery context: "; -  +    #ifdef DEBUG    dump_backlog();   #endif    -  fprintf(stderr,"%s %s",exit_on_error,buf); +  fprintf(stderr,"No error recovery context!\n%s",buf);    exit(99);    }   
113:    throw(); /* Hope someone is catching, or we will be out of balls. */   }    + void exit_on_error(void *msg) + { + #ifdef DEBUG +  dump_backlog(); + #endif +  fprintf(stderr,"%s\n",(char *)msg); +  exit(1); + } +  + void fatal_on_error(void *msg) + { + #ifdef DEBUG +  dump_backlog(); + #endif +  fprintf(stderr,"%s\n",(char *)msg); +  abort(); + } +    void error(char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;