]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/async.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / basic / async.c
index 7725e6d7d363e7ee17821214863525dd062e4c18..d368b925223fd01c959a8d2befb7d097d1a37abb 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
 #include <pthread.h>
+#include <stddef.h>
 #include <unistd.h>
 
 #include "async.h"
+#include "fd-util.h"
 #include "log.h"
+#include "macro.h"
 #include "util.h"
 
 int asynchronous_job(void* (*func)(void *p), void *arg) {
@@ -67,7 +70,7 @@ int asynchronous_sync(void) {
 }
 
 static void *close_thread(void *p) {
-        assert_se(close_nointr(PTR_TO_INT(p)) != -EBADF);
+        assert_se(close_nointr(PTR_TO_FD(p)) != -EBADF);
         return NULL;
 }
 
@@ -83,7 +86,7 @@ int asynchronous_close(int fd) {
         if (fd >= 0) {
                 PROTECT_ERRNO;
 
-                r = asynchronous_job(close_thread, INT_TO_PTR(fd));
+                r = asynchronous_job(close_thread, FD_TO_PTR(fd));
                 if (r < 0)
                          assert_se(close_nointr(fd) != -EBADF);
         }