home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume13 / vn.jan.88 / part03 / printex.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-30  |  678 b   |  39 lines

  1. /*
  2. ** vn news reader.
  3. **
  4. ** printex.c - print fatal error message and exit.
  5. **
  6. ** see copyright disclaimer / history in vn.c source file
  7. */
  8. #include <stdio.h>
  9. #include <setjmp.h>
  10. #include "config.h"
  11. #include "tty.h"
  12.  
  13. extern int errno;    /* unix error number */
  14.  
  15. /*
  16.     error/abnormal condition cleanup and abort routine
  17.     pass stack to printf
  18. */
  19. printex (s,a,b,c,d,e,f)
  20. char *s;
  21. long a,b,c,d,e,f;
  22. {
  23.     static int topflag=0;
  24.     if (topflag == 0)
  25.     {
  26.         ++topflag;
  27.         term_set (STOP);
  28.         tty_set (COOKED);
  29.         fflush (stdout);
  30.         fprintf (stderr,s,a,b,c,d,e,f);
  31.         fprintf (stderr," (error code %d)\n",errno);
  32.         vns_exit(1);
  33.         stat_end(-1);
  34.         exit (1);
  35.     }
  36.     else
  37.         fprintf (stderr,s,a,b,c,d,e,f);
  38. }
  39.