summaryrefslogtreecommitdiff
path: root/test-sigchain.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-01 01:43:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-01 01:43:56 (GMT)
commitfa5bc8abb35e34f673c41cb5c66d0a2f21536861 (patch)
treee76e7f9d8d64db34f148f7ddfa6bca928c194d65 /test-sigchain.c
parent2edefe38a813deb4dfbd62dcf47520aeb1af15fc (diff)
parent0ea8039644968e53d79a8dfbf739c87af4261d46 (diff)
downloadgit-fa5bc8abb35e34f673c41cb5c66d0a2f21536861.zip
git-fa5bc8abb35e34f673c41cb5c66d0a2f21536861.tar.gz
git-fa5bc8abb35e34f673c41cb5c66d0a2f21536861.tar.bz2
Merge branch 'jk/signal-cleanup'
* jk/signal-cleanup: t0005: use SIGTERM for sigchain test pager: do wait_for_pager on signal death refactor signal handling for cleanup functions chain kill signals for cleanup functions diff: refactor tempfile cleanup handling Windows: Fix signal numbers
Diffstat (limited to 'test-sigchain.c')
-rw-r--r--test-sigchain.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test-sigchain.c b/test-sigchain.c
new file mode 100644
index 0000000..42db234
--- /dev/null
+++ b/test-sigchain.c
@@ -0,0 +1,22 @@
+#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;
+}