]> source.dussan.org Git - rspamd.git/commitdiff
Fix siginfo detection code.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 24 Oct 2011 15:30:43 +0000 (18:30 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 24 Oct 2011 15:30:43 +0000 (18:30 +0300)
CMakeLists.txt
config.h.in
src/util.c
src/util.h

index 3f0356173e5df2b09da1f7469437caff86f1060e..23425e86a32c909bf3f7193cc9e359a752dd5dd6 100644 (file)
@@ -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)
index eb20d7b5d18c70302810b462931d17f14ac9cb9a..950bf2ef4f67ebe69958e60337a939cc228caee0 100644 (file)
@@ -40,6 +40,8 @@
 
 #cmakedefine HAVE_SYSLOG_H       1
 
+#cmakedefine HAVE_SIGINFO_H      1
+
 #cmakedefine HAVE_LIBUTIL_H      1
 
 #cmakedefine HAVE_LIBGEN_H       1
 
 #include <errno.h>
 #include <signal.h>
+#ifdef HAVE_SIGINFO_H
+# include <siginfo.h>
+#endif
 #include <event.h>
 #include <glib.h>
 
index 3ddfe3b611fe33b961d2282d12045f6d22db3c62..d127651e7f47e8e0fc3bb6f30f44a32594b36702 100644 (file)
@@ -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;
index 0fb6f48bffc52f7730f49fa1f28fcf755a74d106..c6c721ed1dffdd57b68f45653c067247059adbd9 100644 (file)
@@ -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
 
 /*