https://github.com/git/git
Raw File
Tip revision: 69f9a6e54a46c4a75dff680047a465d04cca20ca authored by Junio C Hamano on 05 June 2015, 19:15:57 UTC
Git 2.4.3
Tip revision: 69f9a6e
test-sigchain.c
#include "cache.h"
#include "sigchain.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