From 7a05fb43acef9f97738888e33ab82502763be445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Wed, 13 Dec 2023 10:07:32 -0500 Subject: [PATCH] Assume __zipos_close when closing a zipos fd --- libc/calls/close.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libc/calls/close.c b/libc/calls/close.c index 774e97e72..25a143b6d 100644 --- a/libc/calls/close.c +++ b/libc/calls/close.c @@ -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()) {