pkgsrc/sysutils/syslog-ng/patches/patch-lib_signal-handler.c
bouyer 182ae0a1f1 syslog-ng overloads sigaction() with its own version, and calls the libc
sigaction() with a dlsym call. On NetBSD this ends up calling the compatibility
sigaction() which fails with ENOSYS if COMPAT_13 is not in the kernel.
Even with COMPAT_13 it would be incorrect because we call the compat
sigaction() with the non-compat arguments.

On NetBSD, fix this by calling explicitely __libc_sigaction14().
Bump PKGREVISION
2019-03-15 10:04:00 +00:00

23 lines
719 B
C

$NetBSD: patch-lib_signal-handler.c,v 1.1 2019/03/15 10:04:00 bouyer Exp $
sigaction() is the old, compat syscall. On NetBSD call the up to date one.
--- lib/signal-handler.c.orig 2019-03-15 09:25:35.669181384 +0100
+++ lib/signal-handler.c 2019-03-15 09:29:02.023178726 +0100
@@ -45,6 +45,9 @@
static int
call_original_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
{
+#ifdef __NetBSD__
+ __libc_sigaction14(signum, act, oldact);
+#else
static int (*real_sa)(int, const struct sigaction *, struct sigaction *);
if (real_sa == NULL)
@@ -52,6 +55,7 @@
real_sa = dlsym(RTLD_NEXT, "sigaction");
}
return real_sa(signum, act, oldact);
+#endif
}
static gboolean