Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: check deleted .zwc files



> What happens if the file has been deleted and re-created?  zwcstat()
> will return the stat info for the newly-created file, but what will
> autoloading do with the now-obsolete (?) file handle?

Oops.  It will do nothing with it, just as it did nothing with it before.
It'll check device/inode against the existing file rather than the
replaced one.

Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.31
diff -u -r1.31 utils.c
--- Src/utils.c	2001/06/08 18:34:53	1.31
+++ Src/utils.c	2001/06/08 19:03:05
@@ -3839,7 +3839,9 @@
     if (stat(filename, buf)) {
 #ifdef HAVE_FSTAT
 	for (f = dumps; f; f = f->next) {
-	    if (!fstat(f->fd, buf)) return 0;
+	    if (!strncmp(filename, f->filename, strlen(f->filename)) &&
+		!fstat(f->fd, buf))
+		return 0;
 	}
 #endif
 	return 1;



Messages sorted by: Reverse Date, Date, Thread, Author