From c926085c7e01a93e326e8081f466d23304767a36 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 20 Jul 2020 21:40:14 +0200 Subject: [PATCH] BUILD: ebtree: fix build on libmusl after recent introduction of eb_memcmp() In order to address a corner case with memory compares, commit 853926a ("BUG/MEDIUM: ebtree: use a byte-per-byte memcmp() to compare memory blocks") introduced a new eb_memcmp() function, which uses ssize_t for an offset. However this one is not known by default in ebtree for versions prior to 2.2, and it depends on the libs. Musl requires unistd to be included to have it. This patch just adds this harmless include, which was verified to address issue #760. There is no mainline commit ID as 2.2 and above already include unistd.h as part of haproxy/api.h. It must be backported to older versions (2.0 already has the commit above). --- ebtree/ebtree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ebtree/ebtree.c b/ebtree/ebtree.c index e82ed59..10cc2ff 100644 --- a/ebtree/ebtree.c +++ b/ebtree/ebtree.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "ebtree.h" void eb_delete(struct eb_node *node) -- 1.7.10.4