async: add trivial cleanup wrapper for asynchronous_close()
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Dec 2020 09:07:12 +0000 (10:07 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Dec 2020 16:39:17 +0000 (17:39 +0100)
(cherry picked from commit 1d9aa4d572b661fd6500c55ab524141332f76230)

src/basic/async.h

index 3160613184b9653cc78c041d6c195623ef9ef18a..260bc9f473308d2ea273fad14f13f28761ce90db 100644 (file)
@@ -1,7 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
+#include <sys/types.h>
+
+#include "macro.h"
+
 int asynchronous_job(void* (*func)(void *p), void *arg);
 
 int asynchronous_sync(pid_t *ret_pid);
 int asynchronous_close(int fd);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(int, asynchronous_close);