Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: e8dde3e5f9ddb7cf95a6ff3cea6cf07c3a2db80d authored by Junio C Hamano on 06 April 2012, 17:47:58 UTC
Git 1.7.10
Tip revision: e8dde3e
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