]>
Commit | Line | Data |
---|---|---|
e154a6f3 | 1 | #include "test-tool.h" |
1c4b6604 | 2 | #include "sigchain.h" |
4a16d072 JK |
3 | |
4 | #define X(f) \ | |
5 | static void f(int sig) { \ | |
6 | puts(#f); \ | |
7 | fflush(stdout); \ | |
8 | sigchain_pop(sig); \ | |
9 | raise(sig); \ | |
10 | } | |
11 | X(one) | |
12 | X(two) | |
13 | X(three) | |
14 | #undef X | |
15 | ||
126e3b3d | 16 | int cmd__sigchain(int argc UNUSED, const char **argv UNUSED) |
3b335762 | 17 | { |
0ea80396 JK |
18 | sigchain_push(SIGTERM, one); |
19 | sigchain_push(SIGTERM, two); | |
20 | sigchain_push(SIGTERM, three); | |
21 | raise(SIGTERM); | |
4a16d072 JK |
22 | return 0; |
23 | } |