Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 1f9b620fdbf27835f54b11008d64c4014b8f4c32 authored by Junio C Hamano on 20 April 2009, 00:34:26 UTC
GIT 1.6.2.4
Tip revision: 1f9b620
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