https://github.com/git/git
Revision 4133fd25525022f99d2c7ba339618433bdd919fe authored by Junio C Hamano on 10 February 2010, 21:44:11 UTC, committed by Junio C Hamano on 10 February 2010, 21:44:11 UTC
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 216d2e0
Raw File
Tip revision: 4133fd25525022f99d2c7ba339618433bdd919fe authored by Junio C Hamano on 10 February 2010, 21:44:11 UTC
Git 1.6.6.2
Tip revision: 4133fd2
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