summaryrefslogtreecommitdiff
path: root/test-sigchain.c
blob: 8747deac627d5e3d57cd1f072f34802d29efa25e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "sigchain.h"
#include "cache.h"

#define X(f) \
static void f(int sig) { \
	puts(#f); \
	fflush(stdout); \
	sigchain_pop(sig); \
	raise(sig); \
}
X(one)
X(two)
X(three)
#undef X

int main(int argc, char **argv) {
	sigchain_push(SIGINT, one);
	sigchain_push(SIGINT, two);
	sigchain_push(SIGINT, three);
	raise(SIGINT);
	return 0;
}