1 /* 2 ** Sendmail 3 ** Copyright (c) 1983 Eric P. Allman 4 ** Berkeley, California 5 ** 6 ** Copyright (c) 1983 Regents of the University of California. 7 ** All rights reserved. The Berkeley software License Agreement 8 ** specifies the terms and conditions for redistribution. 9 */ 10 11 #ifndef lint 12 static char SccsId[] = "@(#)sysexits.c 5.1 (Berkeley) 06/07/85"; 13 #endif not lint 14 15 # include <sysexits.h> 16 # include "useful.h" 17 18 SCCSID(@(#)sysexits.c 5.1 06/07/85); 19 20 /* 21 ** SYSEXITS.C -- error messages corresponding to sysexits.h 22 */ 23 24 char *SysExMsg[] = 25 { 26 /* 64 USAGE */ "500 Bad usage", 27 /* 65 DATAERR */ "501 Data format error", 28 /* 66 NOINPUT */ "550 Cannot open input", 29 /* 67 NOUSER */ "550 User unknown", 30 /* 68 NOHOST */ "550 Host unknown", 31 /* 69 UNAVAILABLE */ "554 Service unavailable", 32 /* 70 SOFTWARE */ "554 Internal error", 33 /* 71 OSERR */ "451 Operating system error", 34 /* 72 OSFILE */ "554 System file missing", 35 /* 73 CANTCREAT */ "550 Can't create output", 36 /* 74 IOERR */ "451 I/O error", 37 /* 75 TEMPFAIL */ "250 Deferred", 38 /* 76 PROTOCOL */ "554 Remote protocol error", 39 /* 77 NOPERM */ "550 Insufficient permission", 40 }; 41 42 int N_SysEx = sizeof SysExMsg / sizeof SysExMsg[0]; 43 /* 44 ** STATSTRING -- return string corresponding to an error status 45 ** 46 ** Parameters: 47 ** stat -- the status to decode. 48 ** 49 ** Returns: 50 ** The string corresponding to that status 51 ** 52 ** Side Effects: 53 ** none. 54 */ 55 56 char * 57 statstring(stat) 58 int stat; 59 { 60 static char ebuf[100]; 61 62 stat -= EX__BASE; 63 if (stat < 0 || stat >= N_SysEx) 64 { 65 (void) sprintf(ebuf, "554 Unknown status %d", stat + EX__BASE); 66 return (ebuf); 67 } 68 69 return (SysExMsg[stat]); 70 } 71