check for error_message
authorDerrick Brashear <shadow@dementia.org>
Mon, 1 Nov 2010 01:58:37 +0000 (21:58 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 1 Nov 2010 12:20:54 +0000 (05:20 -0700)
IRIX apparently has enough krb5 to try building aklog, but no
error_message. ok. so let's cope

Change-Id: I3cb6d529829de348f73d5c9f5380e153f8ccce52
Reviewed-on: http://gerrit.openafs.org/3208
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/aklog/aklog.c
src/cf/krb5.m4
src/config/afsconfig-windows.h

index a4d56a3..81be7eb 100644 (file)
@@ -338,8 +338,10 @@ redirect_errors(const char *who, afs_int32 code, const char *fmt, va_list ap)
        if (strncmp(str, "unknown", strlen("unknown")) == 0) {
 #ifdef HAVE_KRB5_SVC_GET_MSG
            krb5_svc_get_msg(code,&str);
-#else
+#elif defined(HAVE_ERROR_MESSAGE)
            str = error_message(code);
+#else
+           ; /* IRIX apparently has neither: use the string we have */
 #endif
        }
        fputs(str, stderr);
index a14dd2f..898c29c 100644 (file)
@@ -139,9 +139,10 @@ AC_DEFUN([_RRA_LIB_KRB5_MANUAL],
      [AC_CHECK_FUNCS([krb5_free_error_message])],
      [AC_CHECK_FUNCS([krb5_get_error_string], ,
          [AC_CHECK_FUNCS([krb5_get_err_txt], ,
+            [AC_CHECK_FUNCS([error_message], ,
              [AC_CHECK_FUNCS([krb5_svc_get_msg],
                  [AC_CHECK_HEADERS([ibm_svc/krb5_svc.h])],
-                 [AC_CHECK_HEADERS([et/com_err.h])])])])])
+                 [AC_CHECK_HEADERS([et/com_err.h])])])])])])
  RRA_LIB_KRB5_RESTORE])
 
 dnl Sanity-check the results of krb5-config and be sure we can really link a
index d23a8c0..b7ba7a5 100644 (file)
@@ -49,6 +49,9 @@
 /* Define if you have the connect function.  */
 #undef HAVE_CONNECT
 
+/* Define if you have the error_message function.  */
+#define HAVE_ERROR_MESSAGE
+
 /* Define if you have the gethostbyname function.  */
 #define HAVE_GETHOSTBYNAME