]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: wdt: Move the definitions of WDTSIG and DEBUGSIG into types/signal.h.
authorOlivier Houchard <cognet@ci0.org>
Wed, 18 Mar 2020 12:07:19 +0000 (13:07 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 18 Mar 2020 12:07:19 +0000 (13:07 +0100)
Move the definition of WDTSIG and DEBUGSIG from wdt.c and debug.c into
types/signal.h, so that we can access them in another file.
We need those definition to avoid blocking those signals when running
__signal_process_queue().

This should be backported to 2.1, 2.0 and 1.9.

include/types/signal.h
src/debug.c
src/wdt.c

index 598001eeb6a4cc729481a7acda2bd6d96d786b8e..ec3dcf2da18116fd126c8b25f098f88dbf1b4971 100644 (file)
 #define SIG_F_TYPE_FCT          0x0002  /* handler is a function + arg */
 #define SIG_F_TYPE_TASK         0x0004  /* handler is a task + reason */
 
+/* Define WDTSIG if available */
+#if defined(USE_RT) && (_POSIX_TIMERS > 0) && defined(_POSIX_THREAD_CPUTIME)
+
+
+/* We'll deliver SIGALRM when we've run out of CPU as it's not intercepted by
+ * gdb by default.
+ */
+#define WDTSIG SIGALRM
+
+#endif
+
+#ifdef USE_THREAD_DUMP
+/* The signal to trigger a debug dump on a thread is SIGURG. It has the benefit
+ * of not stopping gdb by default, so that issuing "show threads" in a process
+ * being debugged has no adverse effect.
+ */
+#define DEBUGSIG SIGURG
+
+#endif
+
 /* those are highly dynamic and stored in pools */
 struct sig_handler {
        struct list list;
index c11ab544de9f138a72af415b1f45f7f20fa94078..dd13aa4f74225b0afbc7e73d9a3a208f417fac74 100644 (file)
@@ -29,6 +29,7 @@
 #include <common/standard.h>
 
 #include <types/global.h>
+#include <types/signal.h>
 
 #include <proto/cli.h>
 #include <proto/fd.h>
@@ -687,12 +688,6 @@ void ha_thread_dump_all_to_trash()
 
 #else /* below USE_THREAD_DUMP is set */
 
-/* The signal to trigger a debug dump on a thread is SIGURG. It has the benefit
- * of not stopping gdb by default, so that issuing "show threads" in a process
- * being debugged has no adverse effect.
- */
-#define DEBUGSIG SIGURG
-
 /* ID of the thread requesting the dump */
 static unsigned int thread_dump_tid;
 
index 44b35402abbbbcb7ce5598c363dbdfbdcc12fb3d..f8bd65723b5ddf2f5c5bbb8b55d1c9651bc6e69e 100644 (file)
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -18,6 +18,7 @@
 #include <common/initcall.h>
 #include <common/standard.h>
 #include <types/global.h>
+#include <types/signal.h>
 #include <proto/log.h>
 
 
  */
 #if defined(USE_RT) && (_POSIX_TIMERS > 0) && defined(_POSIX_THREAD_CPUTIME)
 
-/* We'll deliver SIGALRM when we've run out of CPU as it's not intercepted by
- * gdb by default.
- */
-#define WDTSIG SIGALRM
-
 /* Setup (or ping) the watchdog timer for thread <thr>. Returns non-zero on
  * success, zero on failure. It interrupts once per second of CPU time. It
  * happens that timers based on the CPU time are not automatically re-armed