[pkg-firebird-general] Bug#626931: [Firebird-devel] Bug#626931: Bug#626931: Bug#626931: FTBFS on GNU/Hurd
Samuel Thibault
sthibault at debian.org
Sat Aug 20 14:20:24 UTC 2011
Hello,
Alex Peshkoff, le Wed 18 May 2011 10:27:32 +0400, a écrit :
> > ../src/jrd/os/posix/isc_ipc.cpp:187:31: error: 'SA_SIGINFO' was not
> > declared in
> > this scope
Indeed, some systems do not have SA_SIGINFO. I'd suggest the attached
patch to cope with them.
Samuel
-------------- next part --------------
--- src/jrd/os/posix/isc_ipc.cpp.original 2011-08-20 16:12:53.342786365 +0200
+++ src/jrd/os/posix/isc_ipc.cpp 2011-08-20 16:14:54.042717109 +0200
@@ -124,7 +124,11 @@
static bool isc_signal2(int signal, FPTR_VOID handler, void* arg, ULONG);
static SIG que_signal(int signal, FPTR_VOID handler, void* arg, int flags, bool w_siginfo);
+#ifdef SA_SIGINFO
static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context);
+#else
+static void CLIB_ROUTINE signal_action(int number);
+#endif
#ifndef SIG_HOLD
#define SIG_HOLD SIG_DFL
@@ -183,20 +187,34 @@
if (!sig) {
struct sigaction act, oact;
+#ifdef SA_SIGINFO
act.sa_sigaction = signal_action;
act.sa_flags = SA_RESTART | SA_SIGINFO;
+#else
+ act.sa_handler = signal_action;
+#endif
sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask, signal_number);
sigaction(signal_number, &act, &oact);
+#ifdef SA_SIGINFO
old_sig_w_siginfo = oact.sa_flags & SA_SIGINFO;
+#endif
- if (oact.sa_sigaction != signal_action &&
+ if (
+#ifdef SA_SIGINFO
+ oact.sa_sigaction != signal_action &&
+#else
+ oact.sa_handler != signal_action &&
+#endif
oact.sa_handler != SIG_DFL &&
oact.sa_handler != SIG_HOLD &&
oact.sa_handler != SIG_IGN)
{
- que_signal(signal_number, old_sig_w_siginfo ?
+ que_signal(signal_number,
+#ifdef SA_SIGINFO
+ old_sig_w_siginfo ?
reinterpret_cast<FPTR_VOID>(oact.sa_sigaction) :
+#endif
reinterpret_cast<FPTR_VOID>(oact.sa_handler),
NULL, SIG_client, old_sig_w_siginfo);
rc = true;
@@ -322,6 +340,12 @@
DEV_REPORT("que_signal: out of memory");
return NULL; /* NOMEM: not handled, too difficult */
}
+#ifndef SA_SIGINFO
+ if (sig_w_siginfo) {
+ DEV_REPORT("SA_SIGINFO not supported");
+ return NULL;
+ }
+#endif
#ifdef DEBUG_GDS_ALLOC
/* This will only be freed when a signal handler is de-registered
@@ -344,7 +368,11 @@
}
+#ifdef SA_SIGINFO
static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context)
+#else
+static void CLIB_ROUTINE signal_action(int number)
+#endif
{
/**************************************
*
@@ -364,11 +392,13 @@
{
if (sig->sig_flags & SIG_client)
{
+#ifdef SA_SIGINFO
if (sig->sig_w_siginfo)
{
(*sig->sig_routine.client3)(number, siginfo, context);
}
else
+#endif
{
(*sig->sig_routine.client1)(number);
}
More information about the pkg-firebird-general
mailing list