https://github.com/git/git
Raw File
Tip revision: 6e97ef31ce20ff93a4cc0e3c6ab5171fd6dda5f3 authored by Junio C Hamano on 05 January 2011, 22:49:19 UTC
Git 1.7.3.5
Tip revision: 6e97ef3
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