blob: 37a37603f6702db3532806d5dc74354f171add2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#define CCAN_LIST_DEBUG 1
#include <ccan/list/list.h>
#include <ccan/tap/tap.h>
#include <ccan/list/list.c>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
int main(int argc, char *argv[])
{
struct ccan_list_head list1, list2;
struct ccan_list_node n1, n2, n3;
pid_t child;
int status;
plan_tests(1);
ccan_list_head_init(&list1);
ccan_list_head_init(&list2);
ccan_list_add(&list1, &n1);
ccan_list_add(&list2, &n2);
ccan_list_add_tail(&list2, &n3);
child = fork();
if (child) {
wait(&status);
} else {
/* This should abort. */
ccan_list_del_from(&list1, &n3);
exit(0);
}
ok1(WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT);
ccan_list_del_from(&list2, &n3);
return exit_status();
}
|