+2005-03-04 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Check return type of gmtime_r, and define
+ GMTIME_R_RETURNS_INT if it returns int. If the return type can't
+ be determined, pretend the function isn't there.
+
2005-02-08 Ken Raeburn <raeburn@mit.edu>
* k5-platform.h (PROGRAM_EXITING) [__GNUC__ && !_WIN32 &&
fi
fi
+if test "$ac_cv_func_gmtime_r" = yes; then
+ AC_MSG_CHECKING([whether gmtime_r returns int])
+ AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
+ [AC_TRY_COMPILE([#include <time.h>
+ extern int gmtime_r ();], [1;], return_int=yes, return_int=no)
+ AC_TRY_COMPILE([#include <time.h>
+ extern struct tm *gmtime_r ();], [1;], return_ptr=yes, return_ptr=no)
+ case $return_int/$return_ptr in
+ yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
+ no/yes) krb5_cv_gmtime_r_returns_int=no ;;
+ *) # Can't figure it out, punt the function.
+ ac_cv_func_gmtime_r=no ;;
+ esac])
+ if test "$ac_cv_func_gmtime_r" = no; then
+ AC_MSG_RESULT(unknown -- ignoring gmtime_r)
+ else
+ AC_MSG_RESULT($krb5_cv_gmtime_r_returns_int)
+ if test "$krb5_cv_gmtime_r_returns_int" = yes; then
+ AC_DEFINE(GMTIME_R_RETURNS_INT,1,[Define if gmtime_r returns int instead of struct tm pointer, as on old HP-UX systems.])
+ fi
+ fi
+fi
+
AC_CHECK_FUNC(getservbyname_r,[
ac_cv_func_getservbyname_r=yes
if test "$ac_cv_func_getservbyname_r" = yes; then
+2005-03-04 Ken Raeburn <raeburn@mit.edu>
+
+ * asn1_encode.c (asn1_encode_generaltime): If gmtime_r returns int
+ instead of pointer, do the appropriate error checking.
+
2004-12-28 Ezra Peisach <epeisach@mit.edu>
* asn1_decode.c (asn1_decode_generaltime): Fix memory leak when
* and some bogus implementations might overrun on the sprintf.
*/
#ifdef HAVE_GMTIME_R
+# ifdef GMTIME_R_RETURNS_INT
+ if (gmtime_r(&gmt_time, >imebuf) != 0)
+ return ASN1_BAD_GMTIME;
+# else
if (gmtime_r(&gmt_time, >imebuf) == NULL)
return ASN1_BAD_GMTIME;
+# endif
#else
gtime = gmtime(&gmt_time);
if (gtime == NULL)