mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 08:48:29 +00:00
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:
parent
10a766ebd0
commit
39688a73e4
69 changed files with 460 additions and 1976 deletions
|
@ -29,19 +29,17 @@
|
|||
* @param fd is vetted by close()
|
||||
*/
|
||||
int __zipos_close(int fd) {
|
||||
int rc;
|
||||
struct ZiposHandle *h;
|
||||
h = (struct ZiposHandle *)(intptr_t)g_fds.p[fd].handle;
|
||||
ZTRACE("__zipos_close(%.*s)",
|
||||
ZIP_CFILE_NAMESIZE(__zipos_get()->map + h->cfile),
|
||||
ZIP_CFILE_NAME(__zipos_get()->map + h->cfile));
|
||||
if (!IsWindows()) {
|
||||
sys_close(fd);
|
||||
rc = sys_close(fd);
|
||||
} else {
|
||||
CloseHandle(h->handle);
|
||||
rc = 0; /* no system file descriptor needed on nt */
|
||||
}
|
||||
if (!__vforked) {
|
||||
free(h->freeme);
|
||||
free(h);
|
||||
}
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue