https://github.com/git/git
Raw File
Tip revision: 3e53891f85c58b4adb016a429a1f3b7fae78ca03 authored by Junio C Hamano on 10 December 2012, 21:05:47 UTC
Git 1.8.0.2
Tip revision: 3e53891
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