summaryrefslogtreecommitdiffstats
path: root/src/util/et/error_message.c
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2002-07-03 22:40:42 +0000
committerTom Yu <tlyu@mit.edu>2002-07-03 22:40:42 +0000
commitbc29722caef4b5866c6d60fb99eb79ff0758ea66 (patch)
tree5a4fa4772fc2c7c855ae0481b7d2e6522693d6b2 /src/util/et/error_message.c
parent1c307c6bd5e5a940d83cf4226bc10afe13983bcd (diff)
downloadkrb5-bc29722caef4b5866c6d60fb99eb79ff0758ea66.tar.gz
krb5-bc29722caef4b5866c6d60fb99eb79ff0758ea66.tar.xz
krb5-bc29722caef4b5866c6d60fb99eb79ff0758ea66.zip
2002-07-03 Tom Yu <tlyu@mit.edu>
* Makefile.in: Fix rebuild rules et_?.perl -> et_?.pl. Also, strip the "#!" line. * error_table.h: Fix mac conditional, due to _et_list declaration moving from et_c.awk * et_c.perl, et_h.perl: Remove. * et_c.pl, et_h.pl: Generate. [porting some 1-2-2-branch changes] * com_err.h: Windows should include <win-mac.h> as opposed to <Kerberos5/win-mac.h> * et_c.perl, et_h.perl: Renamed to et_c.pl and et_h.pl because the extension is used as a newline separator heuristic in MacPerl parser * et_c.perl, et_h.perl: Removed #! from the first line to avoid confusing MacPerl * com_err.h, error_message.c, et.pbexp, et_c.awk, et_h.awk: conditionalized com_err so it doesn't need to export et_list on Mac OS X [pullups from 1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14599 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/et/error_message.c')
-rw-r--r--src/util/et/error_message.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c
index 827b52aa7..450148f06 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -27,8 +27,9 @@
#include "com_err.h"
#include "error_table.h"
-#ifdef macintosh
-#include <ErrorLib.h>
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+ #include <KerberosSupport/KerberosSupport.h>
+ #include <KerberosSupport/ErrorLib.h>
#endif
#if defined(_WIN32)
@@ -48,7 +49,7 @@ extern const int sys_nerr;
static char buffer[ET_EBUFSIZ];
-#if (defined(_WIN32) || defined(macintosh))
+#if (defined(_WIN32) || defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)))
/*@null@*/ static struct et_list * _et_list = (struct et_list *) NULL;
#else
/* Old interface compatibility */
@@ -199,12 +200,19 @@ error_message(long code)
oops:
-#if defined(macintosh)
+#if TARGET_OS_MAC
{
/* This may be a Mac OS Toolbox error or an MIT Support Library Error. Ask ErrorLib */
if (GetErrorLongString(code, buffer, ET_EBUFSIZ - 1) == noErr) {
return buffer;
}
+
+#if TARGET_API_MAC_OSX
+ /* ComErr and ErrorLib don't know about this error, ask the system */
+ /* Of course there's no way to tell if it knew what error it got */
+ return (strerror (code));
+#endif
+
}
#endif