Polish recent changes and make improvements

- Simulate SIGPIPE on Windows NT
- Fix commandv() regression on Windows NT
- Fix sigprocmask() strace bug on OpenBSD
- Add many more system calls to --strace logging
- Make errno state more pristine in redbean strace
This commit is contained in:
Justine Tunney 2022-03-19 03:37:00 -07:00
parent 10a766ebd0
commit 39688a73e4
69 changed files with 460 additions and 1976 deletions

View file

@ -28,18 +28,21 @@
* @asyncsignalsafe
*/
int __zipos_stat(const struct ZiposUri *name, struct stat *st) {
int rc;
ssize_t cf;
struct Zipos *zipos;
if (!st) return efault();
if ((zipos = __zipos_get())) {
if ((cf = __zipos_find(zipos, name)) != -1) {
return __zipos_stat_impl(zipos, cf, st);
if (st) {
if ((zipos = __zipos_get())) {
if ((cf = __zipos_find(zipos, name)) != -1) {
rc = __zipos_stat_impl(zipos, cf, st);
} else {
rc = enoent();
}
} else {
ZTRACE("__zipos_stat(%.*s) -> enoent", name->len, name->path);
return enoent();
rc = enoexec();
}
} else {
ZTRACE("__zipos_stat(%.*s) → enoexec", name->len, name->path);
return enoexec();
rc = efault();
}
return rc;
}