From 69aec538b456402170dc723af417ba5c05389c32 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Feb 2013 00:08:53 +0100 Subject: qmail 1.03 import --- sig_catch.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sig_catch.c (limited to 'sig_catch.c') diff --git a/sig_catch.c b/sig_catch.c new file mode 100644 index 0000000..1888765 --- /dev/null +++ b/sig_catch.c @@ -0,0 +1,18 @@ +#include +#include "sig.h" +#include "hassgact.h" + +void sig_catch(sig,f) +int sig; +void (*f)(); +{ +#ifdef HASSIGACTION + struct sigaction sa; + sa.sa_handler = f; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(sig,&sa,(struct sigaction *) 0); +#else + signal(sig,f); /* won't work under System V, even nowadays---dorks */ +#endif +} -- cgit v1.2.3