mirror of
https://github.com/zsh-users/zsh
synced 2024-09-06 08:25:56 +00:00
14813: autoload functions from deleted .zwc files
This commit is contained in:
parent
9675a70946
commit
975c0b44c5
|
@ -1,3 +1,9 @@
|
|||
2001-06-08 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 14813: zshconfig.ac, Src/parse.c, Src/utils.c, Src/zsh.h:
|
||||
try to autoload functions from digest files that are deleted
|
||||
but still open.
|
||||
|
||||
2001-06-08 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 14796: zshconfig.ac: More reliable BROKEN_KILL_ESRCH test.
|
||||
|
|
|
@ -2827,6 +2827,7 @@ load_dump_file(char *dump, struct stat *sbuf, int other, int len)
|
|||
d->addr = addr;
|
||||
d->len = len;
|
||||
d->count = 0;
|
||||
d->filename = ztrdup(dump);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -2854,7 +2855,7 @@ try_dump_file(char *path, char *name, char *file, int *ksh)
|
|||
dig = dyncat(path, FD_EXT);
|
||||
wc = dyncat(file, FD_EXT);
|
||||
|
||||
rd = stat(dig, &std);
|
||||
rd = zwcstat(dig, &std, dumps);
|
||||
rc = stat(wc, &stc);
|
||||
rn = stat(file, &stn);
|
||||
|
||||
|
@ -2934,7 +2935,7 @@ check_dump_file(char *file, struct stat *sbuf, char *name, int *ksh)
|
|||
struct stat lsbuf;
|
||||
|
||||
if (!sbuf) {
|
||||
if (stat(file, &lsbuf))
|
||||
if (zwcstat(file, &lsbuf, dumps))
|
||||
return NULL;
|
||||
sbuf = &lsbuf;
|
||||
}
|
||||
|
@ -3077,6 +3078,7 @@ decrdumpcount(FuncDump f)
|
|||
dumps = p->next;
|
||||
munmap((void *) f->addr, f->len);
|
||||
zclose(f->fd);
|
||||
zsfree(f->filename);
|
||||
zfree(f, sizeof(*f));
|
||||
}
|
||||
}
|
||||
|
|
17
Src/utils.c
17
Src/utils.c
|
@ -3829,3 +3829,20 @@ 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 (!fstat(f->fd, buf)) return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
} else return 0;
|
||||
|
||||
}
|
||||
|
|
|
@ -493,6 +493,7 @@ struct funcdump {
|
|||
Wordcode addr; /* mapped region */
|
||||
int len; /* length */
|
||||
int count; /* reference count */
|
||||
char *filename;
|
||||
};
|
||||
|
||||
struct eprog {
|
||||
|
|
|
@ -912,7 +912,8 @@ dnl AC_FUNC_STRFTIME
|
|||
|
||||
AC_CHECK_FUNCS(strftime difftime gettimeofday \
|
||||
select poll \
|
||||
readlink lstat lchown faccessx fchdir ftruncate \
|
||||
readlink faccessx fchdir ftruncate \
|
||||
fstat lstat lchown \
|
||||
fseeko ftello \
|
||||
mkfifo _mktemp \
|
||||
waitpid wait3 \
|
||||
|
|
Loading…
Reference in a new issue