]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-async.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
8 #include "tmpfile-util.h"
11 static bool test_async
= false;
13 static void *async_func(void *arg
) {
19 int main(int argc
, char *argv
[]) {
21 char name
[] = "/tmp/test-asynchronous_close.XXXXXX";
23 fd
= mkostemp_safe(name
);
25 asynchronous_close(fd
);
27 assert_se(asynchronous_job(async_func
, NULL
) >= 0);
29 assert_se(asynchronous_sync(NULL
) >= 0);
33 assert_se(fcntl(fd
, F_GETFD
) == -1);
34 assert_se(test_async
);