https://github.com/git/git
Raw File
Tip revision: a155a5f075cdc09e584a58d68bdce0c80e6c4b5a authored by Junio C Hamano on 03 December 2013, 19:16:56 UTC
Git 1.8.5.1
Tip revision: a155a5f
test-sigchain.c
#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(SIGTERM, one);
	sigchain_push(SIGTERM, two);
	sigchain_push(SIGTERM, three);
	raise(SIGTERM);
	return 0;
}
back to top