mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 17:01:19 +02:00
calculate the length of the region to map (for mapped zwc files) correctly, including the offset-page-boundary-adjustment (14346)
This commit is contained in:
parent
6f17b7c2e2
commit
a2a1c2411a
@ -1,3 +1,9 @@
|
||||
2001-05-15 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 14346: Src/parse.c: calculate the length of the region to map
|
||||
(for mapped zwc files) correctly, including the
|
||||
offset-page-boundary-adjustment
|
||||
|
||||
2001-05-15 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 14341: Completion/Unix/Command/.distfiles,
|
||||
|
10
Src/parse.c
10
Src/parse.c
@ -2782,7 +2782,7 @@ load_dump_file(char *dump, struct stat *sbuf, int other, int len)
|
||||
{
|
||||
FuncDump d;
|
||||
Wordcode addr;
|
||||
int fd, off;
|
||||
int fd, off, mlen;
|
||||
|
||||
if (other) {
|
||||
static size_t pgsz = 0;
|
||||
@ -2802,15 +2802,17 @@ load_dump_file(char *dump, struct stat *sbuf, int other, int len)
|
||||
pgsz--;
|
||||
}
|
||||
off = len & ~pgsz;
|
||||
} else
|
||||
mlen = len + (len - off);
|
||||
} else {
|
||||
off = 0;
|
||||
|
||||
mlen = len;
|
||||
}
|
||||
if ((fd = open(dump, O_RDONLY)) < 0)
|
||||
return;
|
||||
|
||||
fd = movefd(fd);
|
||||
|
||||
if ((addr = (Wordcode) mmap(NULL, len, PROT_READ, MAP_SHARED, fd, off)) ==
|
||||
if ((addr = (Wordcode) mmap(NULL, mlen, PROT_READ, MAP_SHARED, fd, off)) ==
|
||||
((Wordcode) -1)) {
|
||||
close(fd);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user