Fix some issues with zipos and redbean

- redbean.com -D /zip/dir/ now works, for pure fun
- possibly fixed bug with redbean serving empty files
- zipos stat() mode now indicates directories on windows

See #372
This commit is contained in:
Justine Tunney 2022-03-21 07:34:19 -07:00
parent 4881ae7527
commit d57f87dc40
4 changed files with 49 additions and 9 deletions

View file

@ -273,6 +273,10 @@ noasan void *mmap(void *addr, size_t size, int prot, int flags, int fd,
}
return VIP(efault());
}
if (__isfdkind(fd, kFdZip)) {
STRACE("mmap(%.12p, %'zu) EINVAL (fd is zipos handle)", p, size);
return VIP(einval());
}
STRACE("mmap(%.12p, %'zu, %s, %d, %'ld)% m", p, size,
DescribeMapping(prot, flags, mode), fd, off);
if (fd == -1) {