]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-async.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright © 2014 Ronny Chevalier
13 static bool test_async
= false;
15 static void *async_func(void *arg
) {
21 int main(int argc
, char *argv
[]) {
23 char name
[] = "/tmp/test-asynchronous_close.XXXXXX";
25 fd
= mkostemp_safe(name
);
27 asynchronous_close(fd
);
29 assert_se(asynchronous_job(async_func
, NULL
) >= 0);
31 assert_se(asynchronous_sync(NULL
) >= 0);
35 assert_se(fcntl(fd
, F_GETFD
) == -1);
36 assert_se(test_async
);