mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-10 03:40:29 +00:00
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:
parent
d4978db8a1
commit
f8073ba6e1
1 changed files with 2 additions and 1 deletions
|
@ -235,7 +235,7 @@ void __zipos_postdup(int oldfd, int newfd) {
|
||||||
if (oldfd == newfd) {
|
if (oldfd == newfd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// XXX signals
|
BLOCK_SIGNALS;
|
||||||
__fds_lock();
|
__fds_lock();
|
||||||
if (__isfdkind(newfd, kFdZip)) {
|
if (__isfdkind(newfd, kFdZip)) {
|
||||||
__zipos_free((struct ZiposHandle *)(intptr_t)g_fds.p[newfd].handle);
|
__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];
|
g_fds.p[newfd] = g_fds.p[oldfd];
|
||||||
}
|
}
|
||||||
__fds_unlock();
|
__fds_unlock();
|
||||||
|
ALLOW_SIGNALS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue