fix wildcard MX handling (option W no longer needed); fix
[unix-history] / usr / src / usr.sbin / sendmail / src / sysexits.c
CommitLineData
b2a81223 1/*
dc45ba8c 2 * Copyright (c) 1983 Eric P. Allman
bee79b64
KB
3 * Copyright (c) 1988 Regents of the University of California.
4 * All rights reserved.
5 *
417f7a11 6 * %sccs.include.redist.c%
bee79b64 7 */
b2a81223
DF
8
9#ifndef lint
a0f5c935 10static char sccsid[] = "@(#)sysexits.c 6.1 (Berkeley) %G%";
bee79b64 11#endif /* not lint */
b2a81223 12
f56c6cd5 13#include <sysexits.h>
b3cbe40f 14
f895a45d 15/*
f56c6cd5
KB
16 * SYSEXITS.C -- error messages corresponding to sysexits.h
17 */
18char *SysExMsg[] = {
3ff6d543
EA
19 /* 64 USAGE */ "500 Bad usage",
20 /* 65 DATAERR */ "501 Data format error",
21 /* 66 NOINPUT */ "550 Cannot open input",
22 /* 67 NOUSER */ "550 User unknown",
23 /* 68 NOHOST */ "550 Host unknown",
24 /* 69 UNAVAILABLE */ "554 Service unavailable",
25 /* 70 SOFTWARE */ "554 Internal error",
26 /* 71 OSERR */ "451 Operating system error",
27 /* 72 OSFILE */ "554 System file missing",
28 /* 73 CANTCREAT */ "550 Can't create output",
29 /* 74 IOERR */ "451 I/O error",
e4602f52 30 /* 75 TEMPFAIL */ "250 Deferred",
3ff6d543 31 /* 76 PROTOCOL */ "554 Remote protocol error",
31c7f523 32 /* 77 NOPERM */ "550 Insufficient permission",
f56c6cd5 33 /* 78 CONFIG */ "554 Local configuration error",
b3cbe40f
EA
34};
35
f56c6cd5 36int N_SysEx = sizeof(SysExMsg) / sizeof(SysExMsg[0]);
46f6ec52 37
f56c6cd5
KB
38/*
39 * STATSTRING -- return string corresponding to an error status
40 *
41 * Parameters:
42 * stat -- the status to decode.
43 *
44 * Returns:
45 * The string corresponding to that status
46 *
47 * Side Effects:
48 * none.
49 */
46f6ec52
EA
50char *
51statstring(stat)
52 int stat;
53{
f56c6cd5 54 static char ebuf[50];
46f6ec52
EA
55
56 stat -= EX__BASE;
f56c6cd5
KB
57 if (stat < 0 || stat >= N_SysEx) {
58 (void)sprintf(ebuf, "554 Unknown status %d", stat + EX__BASE);
59 return(ebuf);
46f6ec52 60 }
f56c6cd5 61 return(SysExMsg[stat]);
46f6ec52 62}