mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Cleanup zipos vfork (#1004)
This commit is contained in:
parent
6cedbc746c
commit
3b302e6379
3 changed files with 16 additions and 3 deletions
|
@ -49,7 +49,7 @@ static int close_impl(int fd) {
|
|||
}
|
||||
|
||||
if (__isfdkind(fd, kFdZip)) {
|
||||
if (!__vforked && _weaken(__zipos_close)) {
|
||||
if (_weaken(__zipos_close)) {
|
||||
return _weaken(__zipos_close)(fd);
|
||||
}
|
||||
if (!IsWindows() && !IsMetal()) {
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
*/
|
||||
int __zipos_close(int fd) {
|
||||
int rc;
|
||||
struct ZiposHandle *h;
|
||||
h = (struct ZiposHandle *)(intptr_t)g_fds.p[fd].handle;
|
||||
if (!IsWindows()) {
|
||||
rc = sys_close(fd);
|
||||
} else {
|
||||
rc = 0; // no system file descriptor needed on nt
|
||||
}
|
||||
if (!__vforked) {
|
||||
struct ZiposHandle *h;
|
||||
h = (struct ZiposHandle *)(intptr_t)g_fds.p[fd].handle;
|
||||
__zipos_free(h);
|
||||
}
|
||||
return rc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue