needs to know whether it exists. (It doesn't on the Mac.)
* prof_file.c (profile_update_file): Change use of HAS_STAT to
HAVE_STAT, to confirm with autoconf test. If the stat() call does not
exist, assume that our in-core memory image is correct, and never
re-read the profile file unless we explicitly close it.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7242
dc483132-0cff-0310-8789-
dd5450dbe970
+Thu Dec 21 18:20:46 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * configure.in: Check for the stat call, since profile_update_file
+ needs to know whether it exists. (It doesn't on the Mac.)
+
+ * prof_file.c (profile_update_file): Change use of HAS_STAT to
+ HAVE_STAT, to confirm with autoconf test. If the stat()
+ call does not exist, assume that our in-core memory image
+ is correct, and never re-read the profile file unless we
+ explicitly close it.
+
Fri Oct 6 22:07:01 1995 Theodore Y. Ts'o <tytso@dcl>
* Makefile.in: Remove ##DOS!include of config/windows.in.
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
+AC_HAVE_FUNCS(stat)
ET_RULES
V5_SHARED_LIB_OBJS
CopyHeader(profile.h,$(BUILDTOP)/include)
prf_file_t prf;
{
errcode_t retval;
-#ifdef HAS_STAT
+#ifdef HAVE_STAT
struct stat st;
#endif
FILE *f;
-#ifdef HAS_STAT
+#ifdef HAVE_STAT
if (stat(prf->filename, &st))
return errno;
if (st.st_mtime == prf->timestamp)
return 0;
-#endif
if (prf->root)
profile_free_node(prf->root);
+#else
+ /*
+ * If we don't have the stat() call, assume that our in-core
+ * memory image is correct. That is, we won't reread the
+ * profile file if it changes.
+ */
+ if (prf->root)
+ return 0;
+#endif
f = fopen(prf->filename, "r");
if (f == NULL)
return errno;
fclose(f);
if (retval)
return retval;
-#ifdef HAS_STAT
+#ifdef HAVE_STAT
prf->timestamp = st.st_mtime;
#endif
return 0;