mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-12-21 02:42:18 +00:00
73 lines
1.9 KiB
Diff
73 lines
1.9 KiB
Diff
diff --git a/configure.ac b/configure.ac
|
|
index ace78db..55f5f68 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -2,6 +2,7 @@ AC_INIT([nftlb], [1.1.0], [netfilter-devel@vger.kernel.org])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
+AC_CONFIG_HEADERS([config.h])
|
|
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
|
|
tar-pax no-dist-gzip dist-bzip2 1.6])
|
|
|
|
@@ -25,5 +26,7 @@ AC_CHECK_HEADER([ev.h], [EVENTINC="-include ev.h"],
|
|
[EVENTINC="-include libev/ev.h"],
|
|
[AC_MSG_ERROR([ev.h not found])])])
|
|
|
|
+AC_CHECK_HEADERS([execinfo.h])
|
|
+
|
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
|
AC_OUTPUT
|
|
diff --git a/src/main.c b/src/main.c
|
|
index bca652e..5d7e918 100644
|
|
--- a/src/main.c
|
|
+++ b/src/main.c
|
|
@@ -18,6 +18,7 @@
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
+#include "config.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
@@ -25,6 +26,10 @@
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
|
|
+#ifdef HAVE_EXECINFO_H
|
|
+ #include <execinfo.h>
|
|
+#endif /* HAVE_EXECINFO_H */
|
|
+
|
|
#include "config.h"
|
|
#include "objects.h"
|
|
#include "server.h"
|
|
@@ -88,6 +93,7 @@ static void nftlb_sighandler(int signo)
|
|
exit(EXIT_SUCCESS);
|
|
}
|
|
|
|
+#ifdef HAVE_EXECINFO_H
|
|
static void nftlb_trace() {
|
|
int level;
|
|
|
|
@@ -100,6 +106,7 @@ static void nftlb_trace() {
|
|
if (!obj_recovery())
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
+#endif /* HAVE_EXECINFO_H */
|
|
|
|
static int main_process(const char *config, int mode)
|
|
{
|
|
@@ -189,9 +196,13 @@ int main(int argc, char *argv[])
|
|
|
|
if (signal(SIGINT, nftlb_sighandler) == SIG_ERR ||
|
|
signal(SIGTERM, nftlb_sighandler) == SIG_ERR ||
|
|
+#ifdef HAVE_EXECINFO_H
|
|
signal(SIGPIPE, SIG_IGN) == SIG_ERR ||
|
|
signal(SIGABRT, nftlb_trace) == SIG_ERR ||
|
|
signal(SIGSEGV, nftlb_trace) == SIG_ERR) {
|
|
+#else
|
|
+ signal(sigpipe, sig_ign) == sig_err) {
|
|
+#endif /* have_execinfo_h */
|
|
u_log_print(LOG_ERR, "Error assigning signals");
|
|
return EXIT_FAILURE;
|
|
}
|