Assume __zipos_close when closing a zipos fd

This commit is contained in:
Jōshin 2023-12-13 10:07:32 -05:00
parent 3b302e6379
commit 7a05fb43ac
No known key found for this signature in database

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/state.internal.h"
@ -49,13 +50,8 @@ static int close_impl(int fd) {
}
if (__isfdkind(fd, kFdZip)) {
if (_weaken(__zipos_close)) {
return _weaken(__zipos_close)(fd);
}
if (!IsWindows() && !IsMetal()) {
sys_close(fd);
}
return 0;
unassert(_weaken(__zipos_close));
return _weaken(__zipos_close)(fd);
}
if (!IsWindows() && !IsMetal()) {