From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4520 invoked from network); 8 Jun 2001 19:04:57 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jun 2001 19:04:57 -0000 Received: (qmail 1606 invoked by alias); 8 Jun 2001 19:04:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14815 Received: (qmail 1588 invoked from network); 8 Jun 2001 19:04:34 -0000 Date: Fri, 8 Jun 2001 15:04:45 -0400 From: Clint Adams To: Bart Schaefer Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: check deleted .zwc files Message-ID: <20010608150445.A5394@dman.com> References: <20010608141719.A4626@dman.com> <010608115028.ZM5876@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <010608115028.ZM5876@candle.brasslantern.com>; from schaefer@candle.brasslantern.com on Fri, Jun 08, 2001 at 11:50:28AM -0700 > 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;