mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
shared/async: use safe_close where appropriate
This commit is contained in:
parent
1cbd441b09
commit
3760416ee8
|
@ -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));
|
pid = clone_with_nested_stack(close_func, CLONE_FILES | ((v & NEED_DOUBLE_FORK) ? 0 : SIGCHLD), UINT_TO_PTR(v));
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
assert_se(close_nointr(fd) != -EBADF); /* local fallback */
|
safe_close(fd); /* local fallback */
|
||||||
else if (v & NEED_DOUBLE_FORK) {
|
else if (v & NEED_DOUBLE_FORK) {
|
||||||
|
|
||||||
/* Reap the intermediate child. Key here is that we specify __WCLONE, since we didn't ask for
|
/* Reap the intermediate child. Key here is that we specify __WCLONE, since we didn't ask for
|
||||||
|
|
Loading…
Reference in a new issue