Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 0ce2e396ee9fb0fa07e8381b338e49859dbf03db authored by Junio C Hamano on 17 June 2012, 21:07:15 UTC
Git 1.7.11
Tip revision: 0ce2e39
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