From: Alexandra Ellwood Date: Thu, 28 Oct 1999 21:29:12 +0000 (+0000) Subject: Added support to use ErrorLib to get MIT Support Library and Mac OS Toolbox error... X-Git-Tag: krb5-1.2-beta1~198 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=97b5cb550e0d0fc4af435a7d77b00d724112a894;p=krb5.git Added support to use ErrorLib to get MIT Support Library and Mac OS Toolbox error codes (similar to the way windows does it) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11886 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index 7d03d34e0..b4a0537cf 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -27,12 +27,16 @@ #include "com_err.h" #include "error_table.h" +#ifdef macintosh +#include +#endif + #if defined(_MSDOS) || defined(_WIN32) #define HAVE_STRERROR #endif #ifdef macintosh -#define sys_nerr 100 +#define sys_nerr 100 /* XXX - What is this? */ #endif #if !defined(HAVE_STRERROR) && !defined(SYS_ERRLIST_DECLARED) @@ -143,8 +147,18 @@ KRB5_DLLIMP const char FAR * KRB5_CALLCONV error_message(code) } } #endif - + oops: + +#if defined(macintosh) + { + /* 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; + } + } +#endif + cp = buffer; strcpy(cp, "Unknown code "); cp += sizeof("Unknown code ") - 1; diff --git a/src/util/et/error_table.h b/src/util/et/error_table.h index 02c8d4a4e..2bc907651 100644 --- a/src/util/et/error_table.h +++ b/src/util/et/error_table.h @@ -9,7 +9,11 @@ #include +#if defined(macintosh) +#define ET_EBUFSIZ 256 +#else #define ET_EBUFSIZ 64 +#endif struct et_list { struct et_list *next;