summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/profile/ChangeLog11
-rw-r--r--src/util/profile/configure.in1
-rw-r--r--src/util/profile/prof_file.c16
3 files changed, 24 insertions, 4 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog
index bbeb16db1..908c22695 100644
--- a/src/util/profile/ChangeLog
+++ b/src/util/profile/ChangeLog
@@ -1,3 +1,14 @@
+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.
diff --git a/src/util/profile/configure.in b/src/util/profile/configure.in
index f58fe61a8..100df4529 100644
--- a/src/util/profile/configure.in
+++ b/src/util/profile/configure.in
@@ -7,6 +7,7 @@ AC_PROG_RANLIB
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)
diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c
index b0de1cd3a..468de74a8 100644
--- a/src/util/profile/prof_file.c
+++ b/src/util/profile/prof_file.c
@@ -53,19 +53,27 @@ errcode_t profile_update_file(prf)
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;
@@ -73,7 +81,7 @@ errcode_t profile_update_file(prf)
fclose(f);
if (retval)
return retval;
-#ifdef HAS_STAT
+#ifdef HAVE_STAT
prf->timestamp = st.st_mtime;
#endif
return 0;