Added support to use ErrorLib to get MIT Support Library and Mac OS Toolbox error...
authorAlexandra Ellwood <lxs@mit.edu>
Thu, 28 Oct 1999 21:29:12 +0000 (21:29 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Thu, 28 Oct 1999 21:29:12 +0000 (21:29 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11886 dc483132-0cff-0310-8789-dd5450dbe970

src/util/et/error_message.c
src/util/et/error_table.h

index 7d03d34e01207a495eb2a2d8c8b110fa8665f971..b4a0537cf670bcaaa7ead0c046729e19eb830625 100644 (file)
 #include "com_err.h"
 #include "error_table.h"
 
+#ifdef macintosh
+#include <ErrorLib.h>
+#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;
index 02c8d4a4e127bb6461406c9c3a69608e2e382a69..2bc90765111cd418bb6a15ff1593d57312537812 100644 (file)
@@ -9,7 +9,11 @@
 
 #include <errno.h>
 
+#if defined(macintosh)
+#define ET_EBUFSIZ 256
+#else
 #define ET_EBUFSIZ 64
+#endif
 
 struct et_list {
     struct et_list *next;