]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: thread/pipe: fix build without threads
authorWilly Tarreau <w@1wt.eu>
Sat, 11 Nov 2017 16:58:31 +0000 (17:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 11 Nov 2017 17:00:24 +0000 (18:00 +0100)
Marcus Rückert reported that commit d8b3b65 ("BUG/MEDIUM: splice/threads:
pipe reuse list was not protected.") broke threadless support. Add the
required #ifdef.

src/pipe.c

index c7ce3c58dc99f0c7d12f57e9af1b9d3e235b6479..c161f960f52fe28cd9992b9a382a4be8f754e116 100644 (file)
@@ -14,6 +14,7 @@
 #include <fcntl.h>
 
 #include <common/config.h>
+#include <common/hathreads.h>
 #include <common/memory.h>
 
 #include <types/global.h>
@@ -21,7 +22,9 @@
 
 struct pool_head *pool2_pipe = NULL;
 struct pipe *pipes_live = NULL; /* pipes which are still ready to use */
+#ifdef USE_THREAD
 HA_SPINLOCK_T pipes_lock;       /* lock used to protect pipes list */
+#endif
 int pipes_used = 0;             /* # of pipes in use (2 fds each) */
 int pipes_free = 0;             /* # of pipes unused */