Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: fc14b89a7e6899b8ac3b5751ec2d8c98203ea4c2 authored by Junio C Hamano on 28 November 2011, 22:07:13 UTC
Git 1.7.8-rc4
Tip revision: fc14b89
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