diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-10-24 18:30:43 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-10-24 18:30:43 +0300 |
commit | da3412c27b23e8dbb9330b5c93e4b040d8b6f178 (patch) | |
tree | 2333425e129ad0030c996fefc2c524c7fa5c9844 | |
parent | e8c23daa735874d7a4a5f45d46f96c2702f7f7d1 (diff) | |
download | rspamd-da3412c27b23e8dbb9330b5c93e4b040d8b6f178.tar.gz rspamd-da3412c27b23e8dbb9330b5c93e4b040d8b6f178.zip |
Fix siginfo detection code.
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | config.h.in | 5 | ||||
-rw-r--r-- | src/util.c | 2 | ||||
-rw-r--r-- | src/util.h | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f0356173..23425e86a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -624,6 +624,7 @@ CHECK_INCLUDE_FILES(netinet/in.h HAVE_NETINET_IN_H) CHECK_INCLUDE_FILES(arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES(netdb.h HAVE_NETDB_H) CHECK_INCLUDE_FILES(syslog.h HAVE_SYSLOG_H) +CHECK_INCLUDE_FILES(siginfo.h HAVE_SIGINFO_H) CHECK_INCLUDE_FILES(locale.h HAVE_LOCALE_H) CHECK_INCLUDE_FILES(libgen.h HAVE_LIBGEN_H) CHECK_INCLUDE_FILES(search.h HAVE_SEARCH_H) @@ -665,7 +666,11 @@ CHECK_SYMBOL_EXISTS(MAP_SHARED sys/mman.h HAVE_MMAP_SHARED) CHECK_SYMBOL_EXISTS(MAP_ANON sys/mman.h HAVE_MMAP_ANON) CHECK_SYMBOL_EXISTS(MAP_NOCORE sys/mman.h HAVE_MMAP_NOCORE) CHECK_SYMBOL_EXISTS(_SC_NPROCESSORS_ONLN unistd.h HAVE_SC_NPROCESSORS_ONLN) -CHECK_SYMBOL_EXISTS(SA_SIGINFO "signal.h;siginfo.h" HAVE_SA_SIGINFO) +IF(HAVE_SIGINFO_H) + CHECK_SYMBOL_EXISTS(SA_SIGINFO "signal.h;siginfo.h" HAVE_SA_SIGINFO) +ELSE(HAVE_SIGINFO_H) + CHECK_SYMBOL_EXISTS(SA_SIGINFO "signal.h" HAVE_SA_SIGINFO) +ENDIF(HAVE_SIGINFO_H) IF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") IF(HAVE_CLOCK_GETTIME) diff --git a/config.h.in b/config.h.in index eb20d7b5d..950bf2ef4 100644 --- a/config.h.in +++ b/config.h.in @@ -40,6 +40,8 @@ #cmakedefine HAVE_SYSLOG_H 1 +#cmakedefine HAVE_SIGINFO_H 1 + #cmakedefine HAVE_LIBUTIL_H 1 #cmakedefine HAVE_LIBGEN_H 1 @@ -369,6 +371,9 @@ #include <errno.h> #include <signal.h> +#ifdef HAVE_SIGINFO_H +# include <siginfo.h> +#endif #include <event.h> #include <glib.h> diff --git a/src/util.c b/src/util.c index 3ddfe3b61..d127651e7 100644 --- a/src/util.c +++ b/src/util.c @@ -418,7 +418,7 @@ void init_signals (struct sigaction *signals, void (*sig_handler)(gint, siginfo_t *, void *)) #else void -init_signals (struct sigaction *signals, sighandler_t sig_handler) +init_signals (struct sigaction *signals, void (*sig_handler)(gint)) #endif { struct sigaction sigpipe_act; diff --git a/src/util.h b/src/util.h index 0fb6f48bf..c6c721ed1 100644 --- a/src/util.h +++ b/src/util.h @@ -87,7 +87,7 @@ gint poll_sync_socket (gint fd, gint timeout, short events); #ifdef HAVE_SA_SIGINFO void init_signals (struct sigaction *sa, void (*sig_handler)(gint, siginfo_t *, void *)); #else -void init_signals (struct sigaction *sa, sighandler_t); +void init_signals (struct sigaction *sa, void (*sig_handler)(gint)); #endif /* |