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.
This commit is contained in:
Jōshin 2023-12-14 20:33:00 -05:00
parent d4978db8a1
commit f8073ba6e1
No known key found for this signature in database

View file

@ -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;
}
/**