mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-29 01:31:19 +02:00
CLEANUP: wdt: do not remap SI_TKILL to SI_LWP, test the values directly
We used to remap SI_TKILL to SI_LWP when SI_TKILL was not available (e.g. FreeBSD) but that's ugly and since we need this only in a single switch/case block in wdt.c it's even simpler and cleaner to perform the two tests there, so let's do this.
This commit is contained in:
parent
b474f43816
commit
6414e4423c
@ -23,7 +23,6 @@
|
|||||||
#define _HAPROXY_COMPAT_H
|
#define _HAPROXY_COMPAT_H
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
/* This is needed on Linux for Netfilter includes */
|
/* This is needed on Linux for Netfilter includes */
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -154,11 +153,6 @@ typedef struct { } empty_t;
|
|||||||
#define F_SETPIPE_SZ (1024 + 7)
|
#define F_SETPIPE_SZ (1024 + 7)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* On FreeBSD we don't have SI_TKILL but SI_LWP instead */
|
|
||||||
#if !defined(SI_TKILL) && defined(SI_LWP)
|
|
||||||
#define SI_TKILL SI_LWP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(USE_TPROXY) && defined(USE_NETFILTER)
|
#if defined(USE_TPROXY) && defined(USE_NETFILTER)
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/netfilter_ipv6.h>
|
#include <linux/netfilter_ipv6.h>
|
||||||
|
12
src/wdt.c
12
src/wdt.c
@ -104,11 +104,21 @@ void wdt_handler(int sig, siginfo_t *si, void *arg)
|
|||||||
|
|
||||||
/* No doubt now, there's no hop to recover, die loudly! */
|
/* No doubt now, there's no hop to recover, die loudly! */
|
||||||
break;
|
break;
|
||||||
#ifdef USE_THREAD
|
|
||||||
|
#if defined(USE_THREAD) && defined(SI_TKILL) /* Linux uses this */
|
||||||
|
|
||||||
case SI_TKILL:
|
case SI_TKILL:
|
||||||
/* we got a pthread_kill, stop on it */
|
/* we got a pthread_kill, stop on it */
|
||||||
thr = tid;
|
thr = tid;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#elif defined(USE_THREAD) && defined(SI_LWP) /* FreeBSD uses this */
|
||||||
|
|
||||||
|
case SI_LWP:
|
||||||
|
/* we got a pthread_kill, stop on it */
|
||||||
|
thr = tid;
|
||||||
|
break;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* unhandled other conditions */
|
/* unhandled other conditions */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user