diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /sig_catch.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'sig_catch.c')
| -rw-r--r-- | sig_catch.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ | |||
| 1 | #include <signal.h> | ||
| 2 | #include "sig.h" | ||
| 3 | #include "hassgact.h" | ||
| 4 | |||
| 5 | void sig_catch(sig,f) | ||
| 6 | int sig; | ||
| 7 | void (*f)(); | ||
| 8 | { | ||
| 9 | #ifdef HASSIGACTION | ||
| 10 | struct sigaction sa; | ||
| 11 | sa.sa_handler = f; | ||
| 12 | sa.sa_flags = 0; | ||
| 13 | sigemptyset(&sa.sa_mask); | ||
| 14 | sigaction(sig,&sa,(struct sigaction *) 0); | ||
| 15 | #else | ||
| 16 | signal(sig,f); /* won't work under System V, even nowadays---dorks */ | ||
| 17 | #endif | ||
| 18 | } | ||
