mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-13 01:31:18 +02:00
14813: autoload functions from deleted .zwc files
This commit is contained in:
parent
9675a70946
commit
975c0b44c5
5 changed files with 30 additions and 3 deletions
|
@ -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>
|
2001-06-08 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* 14796: zshconfig.ac: More reliable BROKEN_KILL_ESRCH test.
|
* 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->addr = addr;
|
||||||
d->len = len;
|
d->len = len;
|
||||||
d->count = 0;
|
d->count = 0;
|
||||||
|
d->filename = ztrdup(dump);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2854,7 +2855,7 @@ try_dump_file(char *path, char *name, char *file, int *ksh)
|
||||||
dig = dyncat(path, FD_EXT);
|
dig = dyncat(path, FD_EXT);
|
||||||
wc = dyncat(file, FD_EXT);
|
wc = dyncat(file, FD_EXT);
|
||||||
|
|
||||||
rd = stat(dig, &std);
|
rd = zwcstat(dig, &std, dumps);
|
||||||
rc = stat(wc, &stc);
|
rc = stat(wc, &stc);
|
||||||
rn = stat(file, &stn);
|
rn = stat(file, &stn);
|
||||||
|
|
||||||
|
@ -2934,7 +2935,7 @@ check_dump_file(char *file, struct stat *sbuf, char *name, int *ksh)
|
||||||
struct stat lsbuf;
|
struct stat lsbuf;
|
||||||
|
|
||||||
if (!sbuf) {
|
if (!sbuf) {
|
||||||
if (stat(file, &lsbuf))
|
if (zwcstat(file, &lsbuf, dumps))
|
||||||
return NULL;
|
return NULL;
|
||||||
sbuf = &lsbuf;
|
sbuf = &lsbuf;
|
||||||
}
|
}
|
||||||
|
@ -3077,6 +3078,7 @@ decrdumpcount(FuncDump f)
|
||||||
dumps = p->next;
|
dumps = p->next;
|
||||||
munmap((void *) f->addr, f->len);
|
munmap((void *) f->addr, f->len);
|
||||||
zclose(f->fd);
|
zclose(f->fd);
|
||||||
|
zsfree(f->filename);
|
||||||
zfree(f, sizeof(*f));
|
zfree(f, sizeof(*f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
Src/utils.c
17
Src/utils.c
|
@ -3829,3 +3829,20 @@ mailstat(char *path, struct stat *st)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#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 */
|
Wordcode addr; /* mapped region */
|
||||||
int len; /* length */
|
int len; /* length */
|
||||||
int count; /* reference count */
|
int count; /* reference count */
|
||||||
|
char *filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct eprog {
|
struct eprog {
|
||||||
|
|
|
@ -912,7 +912,8 @@ dnl AC_FUNC_STRFTIME
|
||||||
|
|
||||||
AC_CHECK_FUNCS(strftime difftime gettimeofday \
|
AC_CHECK_FUNCS(strftime difftime gettimeofday \
|
||||||
select poll \
|
select poll \
|
||||||
readlink lstat lchown faccessx fchdir ftruncate \
|
readlink faccessx fchdir ftruncate \
|
||||||
|
fstat lstat lchown \
|
||||||
fseeko ftello \
|
fseeko ftello \
|
||||||
mkfifo _mktemp \
|
mkfifo _mktemp \
|
||||||
waitpid wait3 \
|
waitpid wait3 \
|
||||||
|
|
Loading…
Reference in a new issue