mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Revert "Rewrite ZipOS"
This reverts commit b01282e23e
. Some tests
are broken. It's not clear how it'll impact metal yet. Let's revisit the
memory optimization benefits of this change again sometime soon.
This commit is contained in:
parent
ee8a861635
commit
ff250a0c10
21 changed files with 420 additions and 407 deletions
|
@ -29,7 +29,7 @@ static ssize_t __zipos_read_impl(struct ZiposHandle *h, const struct iovec *iov,
|
|||
int i;
|
||||
int64_t b, x, y;
|
||||
if (h->cfile == ZIPOS_SYNTHETIC_DIRECTORY ||
|
||||
S_ISDIR(GetZipCfileMode(h->zipos->cdir + h->cfile))) {
|
||||
S_ISDIR(GetZipCfileMode(h->zipos->map + h->cfile))) {
|
||||
return eisdir();
|
||||
}
|
||||
if (opt_offset == -1) {
|
||||
|
@ -39,7 +39,7 @@ static ssize_t __zipos_read_impl(struct ZiposHandle *h, const struct iovec *iov,
|
|||
}
|
||||
for (i = 0; i < iovlen && y < h->size; ++i, y += b) {
|
||||
b = MIN(iov[i].iov_len, h->size - y);
|
||||
if (b) memcpy(iov[i].iov_base, h->data + y, b);
|
||||
if (b) memcpy(iov[i].iov_base, h->mem + y, b);
|
||||
}
|
||||
if (opt_offset == -1) {
|
||||
h->pos = y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue