about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-06-09 18:06:32 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-06-09 18:06:32 +0000
commit9fbdcb53116f34d9ac8da1ee1548af20581183aa (patch)
treef64e1227397b9c0aae16a42bbc7b0a4aee299c4e /Src
parent6d17bbde9704319ae4f27e370435e43efbecc93d (diff)
downloadzsh-9fbdcb53116f34d9ac8da1ee1548af20581183aa.tar.gz
zsh-9fbdcb53116f34d9ac8da1ee1548af20581183aa.tar.xz
zsh-9fbdcb53116f34d9ac8da1ee1548af20581183aa.zip
Fix problems with zwcstat() on systems that do not USE_MMAP.
Diffstat (limited to 'Src')
-rw-r--r--Src/parse.c22
-rw-r--r--Src/utils.c19
2 files changed, 22 insertions, 19 deletions
diff --git a/Src/parse.c b/Src/parse.c
index ea0dffdef..09e60ead2 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2775,6 +2775,24 @@ build_cur_dump(char *nam, char *dump, char **names, int match, int map,
 
 static FuncDump dumps;
 
+/**/
+static int
+zwcstat(char *filename, struct stat *buf, FuncDump dumps)
+{
+    FuncDump f;
+    
+    if (stat(filename, buf)) {
+#ifdef HAVE_FSTAT
+	for (f = dumps; f; f = f->next) {
+	    if (!strncmp(filename, f->filename, strlen(f->filename)) &&
+		!fstat(f->fd, buf))
+		return 0;
+	}
+#endif
+	return 1;
+    } else return 0;
+}
+
 /* Load a dump file (i.e. map it). */
 
 static void
@@ -2830,6 +2848,10 @@ load_dump_file(char *dump, struct stat *sbuf, int other, int len)
     d->filename = ztrdup(dump);
 }
 
+#else
+
+#define zwcstat(f, b, d) stat(f, b)
+
 #endif
 
 /* Try to load a function from one of the possible wordcode files for it.
diff --git a/Src/utils.c b/Src/utils.c
index 9ef3ec88c..6bede2e43 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3829,22 +3829,3 @@ mailstat(char *path, struct stat *st)
        return 0;
 }
 #endif
-
-/**/
-mod_export int
-zwcstat(char *filename, struct stat *buf, FuncDump dumps)
-{
-    FuncDump f;
-    
-    if (stat(filename, buf)) {
-#ifdef HAVE_FSTAT
-	for (f = dumps; f; f = f->next) {
-	    if (!strncmp(filename, f->filename, strlen(f->filename)) &&
-		!fstat(f->fd, buf))
-		return 0;
-	}
-#endif
-	return 1;
-    } else return 0;
-    
-}