1: # include   <stdio.h>
   2: # include   <sccs.h>
   3: 
   4: SCCSID(@(#)IIsyserr.c	8.1	12/31/84)
   5: 
   6: 
   7: /*
   8: **  SYSERR -- SYStem ERRor message print and abort
   9: **
  10: **	Syserr acts like a printf with up to five arguments.
  11: **
  12: **	If the first argument to syserr is not zero,
  13: **	the message "SYSERR:" is prepended.
  14: **
  15: **	If the extern variable `IIproc_name' is assigned to a
  16: **	string, that string is prepended to the message.
  17: **
  18: **	All arguments must be null-terminated.
  19: **
  20: **	The function pointed to by `Exitfn' is then called.
  21: **	It is initialized to be `exit'.
  22: */
  23: 
  24: extern char *IIproc_name;
  25: 
  26: IIsyserr(pv)
  27: char    *pv;
  28: {
  29:     int     pid;
  30:     register char   **p;
  31:     extern int  errno;
  32:     register int    usererr;
  33: 
  34:     p = &pv;
  35:     printf("\n");
  36:     usererr = pv == 0;
  37: 
  38:     if (!usererr)
  39:     {
  40:         if (IIproc_name)
  41:             printf("%s ", IIproc_name);
  42:         printf("SYSERR: ");
  43:     }
  44:     else
  45:         p++;
  46:     printf(p[0], p[1], p[2], p[3], p[4], p[5]);
  47:     printf("\n");
  48:     if (!usererr && errno)
  49:         printf("\tsystem error %d\n", errno);
  50:     fflush(stdout);
  51:     exit (-1);
  52: }
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 918
Valid CSS Valid XHTML 1.0 Strict