shared/async: use safe_close where appropriate

This commit is contained in:
Mike Yuan 2023-12-28 18:05:33 +08:00
parent 1cbd441b09
commit 3760416ee8
No known key found for this signature in database
GPG key ID: 417471C0A40F58B3

View file

@ -94,7 +94,7 @@ int asynchronous_close(int fd) {
pid = clone_with_nested_stack(close_func, CLONE_FILES | ((v & NEED_DOUBLE_FORK) ? 0 : SIGCHLD), UINT_TO_PTR(v));
if (pid < 0)
assert_se(close_nointr(fd) != -EBADF); /* local fallback */
safe_close(fd); /* local fallback */
else if (v & NEED_DOUBLE_FORK) {
/* Reap the intermediate child. Key here is that we specify __WCLONE, since we didn't ask for