]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/async: use safe_close where appropriate
authorMike Yuan <me@yhndnzj.com>
Thu, 28 Dec 2023 10:05:33 +0000 (18:05 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 28 Dec 2023 10:26:52 +0000 (18:26 +0800)
src/shared/async.c

index 41f6b97e02861934466f599914585305ea44a833..bbb8b81011a15dc1cbcf83e5f162e6506cf82b33 100644 (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