]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-async.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
7 #include "tmpfile-util.h"
10 static bool test_async
= false;
12 static void *async_func(void *arg
) {
18 int main(int argc
, char *argv
[]) {
20 char name
[] = "/tmp/test-asynchronous_close.XXXXXX";
22 fd
= mkostemp_safe(name
);
24 asynchronous_close(fd
);
26 assert_se(asynchronous_job(async_func
, NULL
) >= 0);
28 assert_se(asynchronous_sync(NULL
) >= 0);
32 assert_se(fcntl(fd
, F_GETFD
) == -1);
33 assert_se(test_async
);