home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / watcher / part01 / baderr.c next >
Encoding:
C/C++ Source or Header  |  1987-09-27  |  853 b   |  36 lines

  1. /* 
  2.    baderr: A bad error has been caught.  Print an error message explaining
  3.     why we are dying, then exit.
  4.  
  5.    Assumptions:
  6.     the signal number in sig is an actual signal number and has an
  7.     entry in sys_siglist (BSD ONLY).
  8.  
  9.    Arguments:
  10.     sig: the number of the signal which brought us here.
  11.  
  12.    Author:
  13.     Kenneth Ingham
  14.  
  15.    Copyright (C) 1987 The University of New Mexico
  16. */
  17.  
  18. #include "defs.h"
  19.  
  20. baderr(sig)
  21. int sig;
  22. {
  23.     extern char *sys_siglist[];
  24.  
  25.     printf("                                            \n");
  26.     printf("                                            \n");
  27. #ifdef BSD
  28.     printf(">> Unrecoverable error.  %s  Bye. <<\n",sys_siglist[sig]);
  29. #else
  30.     printf(">> Unrecoverable error.  Signal %d.  Bye. <<\n", sig);
  31. #endif
  32.     printf("                                            \n");
  33.     printf("                                            \n");
  34.     exit(1);
  35. }
  36.