Define correct EX_ values if sysexits.h is missing.
Showing
1 changed file
with
23 additions
and
14 deletions
... | @@ -34,24 +34,33 @@ | ... | @@ -34,24 +34,33 @@ |
34 | #include <netdb.h> | 34 | #include <netdb.h> |
35 | #include "getopt.h" | 35 | #include "getopt.h" |
36 | 36 | ||
37 | #ifdef HAVE_SYSEXITS_H | ||
38 | # include <sysexits.h> | ||
39 | #endif | ||
40 | |||
41 | #ifndef EX_OK | ||
42 | # define EX_OK 0 | ||
43 | #endif | ||
44 | #ifndef EX_UNAVAILABLE | ||
45 | # define EX_UNAVAILABLE 1 | ||
46 | #endif | ||
47 | #ifndef EX_TEMPFAIL | ||
48 | # define EX_TEMPFAIL 2 | ||
49 | #endif | ||
50 | |||
51 | #ifdef HAVE_STRINGS_H | 37 | #ifdef HAVE_STRINGS_H |
52 | # include <strings.h> | 38 | # include <strings.h> |
53 | #endif | 39 | #endif |
54 | 40 | ||
41 | #ifdef HAVE_SYSEXITS_H | ||
42 | # include <sysexits.h> | ||
43 | #else | ||
44 | # define EX_OK 0 /* successful termination */ | ||
45 | # define EX__BASE 64 /* base value for error messages */ | ||
46 | # define EX_USAGE 64 /* command line usage error */ | ||
47 | # define EX_DATAERR 65 /* data format error */ | ||
48 | # define EX_NOINPUT 66 /* cannot open input */ | ||
49 | # define EX_NOUSER 67 /* addressee unknown */ | ||
50 | # define EX_NOHOST 68 /* host name unknown */ | ||
51 | # define EX_UNAVAILABLE 69 /* service unavailable */ | ||
52 | # define EX_SOFTWARE 70 /* internal software error */ | ||
53 | # define EX_OSERR 71 /* system error (e.g., can't fork) */ | ||
54 | # define EX_OSFILE 72 /* critical OS file missing */ | ||
55 | # define EX_CANTCREAT 73 /* can't create (user) output file */ | ||
56 | # define EX_IOERR 74 /* input/output error */ | ||
57 | # define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ | ||
58 | # define EX_PROTOCOL 76 /* remote error in protocol */ | ||
59 | # define EX_NOPERM 77 /* permission denied */ | ||
60 | # define EX_CONFIG 78 /* configuration error */ | ||
61 | # define EX__MAX 78 /* maximum listed value */ | ||
62 | #endif | ||
63 | |||
55 | #ifndef INADDR_LOOPBACK | 64 | #ifndef INADDR_LOOPBACK |
56 | # define INADDR_LOOPBAK 0x7f000001 | 65 | # define INADDR_LOOPBAK 0x7f000001 |
57 | #endif | 66 | #endif | ... | ... |
-
Please register or sign in to post a comment