From 04aeb72dc19dcaaa3012c691407c8016c3842ed5 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 9 Feb 2012 23:29:10 +0100 Subject: [PATCH] The rest of sighandler separation --- TODO | 1 + ucw/Makefile | 6 +++--- ucw/lib.h | 8 -------- ucw/lizard-safe.c | 1 + ucw/sighandler.c | 1 + ucw/threads.h | 2 ++ 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/TODO b/TODO index db6dcf5e..c35695c7 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,3 @@ - Clean up free/ - gary: Add automatic zeroing +- Remove sighandler.[ch] diff --git a/ucw/Makefile b/ucw/Makefile index 77c5a08f..b8ac841b 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -23,8 +23,8 @@ LIBUCW_MODS= \ bit-ffs bit-fls \ url \ mainloop main-block main-rec \ - proctitle exitstatus runcmd sighandler \ - lizard lizard-safe adler32 \ + proctitle exitstatus runcmd \ + lizard lizard-safe adler32 sighandler \ md5 sha1 sha1-hmac \ base64 base224 \ io-careful io-sync io-mmap io-size \ @@ -52,7 +52,7 @@ LIBUCW_MAIN_INCLUDES= \ url.h \ mainloop.h \ process.h \ - lizard.h \ + lizard.h sighandler.h \ md5.h sha1.h \ base64.h base224.h \ qache.h \ diff --git a/ucw/lib.h b/ucw/lib.h index 29c2d236..7af29468 100644 --- a/ucw/lib.h +++ b/ucw/lib.h @@ -181,14 +181,6 @@ uns random_max(uns max); /** Return a pseudorandom 32-bit number in range [0,@ u64 random_u64(void); /** Return a pseudorandom 64-bit number. **/ u64 random_max_u64(u64 max); /** Return a pseudorandom 64-bit number in range [0,@max). **/ -/* sighandler.c */ - -typedef int (*ucw_sighandler_t)(int); // gets signum, returns nonzero if abort() should be called - -void handle_signal(int signum); -void unhandle_signal(int signum); -ucw_sighandler_t set_signal_handler(int signum, ucw_sighandler_t newh); - /* bigalloc.c */ void *page_alloc(u64 len) LIKE_MALLOC; // allocates a multiple of CPU_PAGE_SIZE bytes with mmap diff --git a/ucw/lizard-safe.c b/ucw/lizard-safe.c index ba7d8df3..06302619 100644 --- a/ucw/lizard-safe.c +++ b/ucw/lizard-safe.c @@ -9,6 +9,7 @@ #include "ucw/lib.h" #include "ucw/threads.h" +#include "ucw/sighandler.h" #include "ucw/lizard.h" #include diff --git a/ucw/sighandler.c b/ucw/sighandler.c index 9cc5f2ae..8f117e76 100644 --- a/ucw/sighandler.c +++ b/ucw/sighandler.c @@ -7,6 +7,7 @@ #include "ucw/lib.h" #include "ucw/threads.h" +#include "ucw/sighandler.h" #include #include diff --git a/ucw/threads.h b/ucw/threads.h index 9334e29e..a0d3f59f 100644 --- a/ucw/threads.h +++ b/ucw/threads.h @@ -10,6 +10,8 @@ #ifndef _UCW_THREADS_H #define _UCW_THREADS_H +#include "ucw/sighandler.h" + /* This structure holds per-thread data */ struct ucwlib_context { -- 2.39.5