From f8073ba6e1be9d89a575c23fe6e6d4e6d3bde5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Thu, 14 Dec 2023 20:33:00 -0500 Subject: [PATCH] Block signals in __zipos_postdup This was wrong before. Now it mirrors `sys_dup_nt`. As far as I can tell this is okay at all call sites; most of the time, there are parallel code paths for `sys_dup_nt` anyway. --- libc/runtime/zipos-open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/runtime/zipos-open.c b/libc/runtime/zipos-open.c index 6841e68a9..9a9ebcb67 100644 --- a/libc/runtime/zipos-open.c +++ b/libc/runtime/zipos-open.c @@ -235,7 +235,7 @@ void __zipos_postdup(int oldfd, int newfd) { if (oldfd == newfd) { return; } - // XXX signals + BLOCK_SIGNALS; __fds_lock(); if (__isfdkind(newfd, kFdZip)) { __zipos_free((struct ZiposHandle *)(intptr_t)g_fds.p[newfd].handle); @@ -249,6 +249,7 @@ void __zipos_postdup(int oldfd, int newfd) { g_fds.p[newfd] = g_fds.p[oldfd]; } __fds_unlock(); + ALLOW_SIGNALS; } /**