diff options
Diffstat (limited to 'src/basic/async.c')
-rw-r--r-- | src/basic/async.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/basic/async.c b/src/basic/async.c index 7725e6d7d3..a1f163f27b 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -19,11 +17,15 @@ 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 +69,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 +85,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); } |