]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: watchdog: use si_value.sival_int, not si_int for the timer's value
authorWilly Tarreau <w@1wt.eu>
Thu, 23 May 2019 06:36:29 +0000 (08:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 May 2019 06:36:29 +0000 (08:36 +0200)
Bah, the linux manpage suggests to use si_int but it's a fake, it's only
a define on sigval.sival_int where sigval is defined as si_value. Let's
use si_value.sival_int, at least it builds on both Linux and FreeBSD. It's
likely that this code will have to be limited to a small subset of OSes
if it causes difficulties like this.

src/wdt.c

index 45438d6b5b04a5dc436ca12bb66e13dcfaac3f0c..60a5fd43202cf36b32ac88aaf6e42b9957532bc5 100644 (file)
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -60,7 +60,7 @@ void wdt_handler(int sig, siginfo_t *si, void *arg)
                 * the thread number from there. Note: this thread might
                 * continue to execute in parallel.
                 */
-               thr = si->si_int;
+               thr = si->si_value.sival_int;
 
                /* cannot happen unless an unknown timer tries to play with our
                 * nerves. Let's die for now if this happens.