X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=common%2Fcommon.h;h=7a176a421a8c252671105f6958e81651d7621b95;hb=43cbaab1fc66139d3dfd87a2f8b6be5d906ee317;hp=0b0cd856fcd85efe2497054d3fea6efa9b03b14b;hpb=d25cf39d7cb4d2df2d7e2fa307c1c8f14bb018cc;p=apps%2Fpfixtools.git diff --git a/common/common.h b/common/common.h index 0b0cd85..7a176a4 100644 --- a/common/common.h +++ b/common/common.h @@ -63,8 +63,8 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -#define __init __attribute__((__used__,__section__(".mad.init"))) -#define __exit __attribute__((__used__,__section__(".mad.exit"))) +#define __init __attribute__((__used__,__section__("MAD_INIT,__text,regular"))) +#define __exit __attribute__((__used__,__section__("MAD_EXIT,__text,regular"))) #define module_init(fn) static __init initcall_t __init_##fn = fn; #define module_exit(fn) static __exit exitcall_t __exit_##fn = fn; @@ -104,13 +104,12 @@ typedef void (*exitcall_t)(void); #define UNIXERR(fun) err("%s:%d:%s %s: %m", \ __FILE__, __LINE__, __func__, fun) -extern sig_atomic_t sigint; -extern sig_atomic_t sighup; extern int log_level; extern bool log_syslog; void common_sighandler(int sig); +int setnonblock(int sock); int tcp_bind(const struct sockaddr *addr, socklen_t len); int tcp_listen(const struct sockaddr *addr, socklen_t len); int tcp_listen_nonblock(const struct sockaddr *addr, socklen_t len); @@ -129,9 +128,6 @@ int common_setup(const char* pidfile, bool unsafe, const char* runas_user, static inline void common_startup(void) { signal(SIGPIPE, SIG_IGN); - signal(SIGINT, &common_sighandler); - signal(SIGTERM, &common_sighandler); - signal(SIGHUP, &common_sighandler); signal(SIGSEGV, &common_sighandler); }