From 6816817410c7170b55abaa23f6c10dddb55e2f56 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Thu, 28 Aug 2025 15:00:19 +0200 Subject: [PATCH] =?utf8?q?BUILD:=20mworker:=20fix=20ignoring=20return=20va?= =?utf8?q?lue=20of=20=E2=80=98read=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix read return value unused result. src/haproxy.c: In function ‘main’: src/haproxy.c:3630:17: error: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] 3630 | read(sock_pair[1], &c, 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~ Must be backported where d7f6819 is backported. --- src/haproxy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index b2dec2e3b..56789020e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3591,6 +3591,7 @@ int main(int argc, char **argv) int sock_pair[2]; char *msg = NULL; char c; + int r; if (socketpair(PF_UNIX, SOCK_STREAM, 0, sock_pair) == -1) { ha_alert("[%s.main()] Cannot create socketpair to update the new worker state\n", @@ -3626,8 +3627,8 @@ int main(int argc, char **argv) * after confirming receipt of the "\n" from the CLI applet, so * we make sure that the fd is received correctly. */ - shutdown(sock_pair[1], SHUT_WR); - read(sock_pair[1], &c, 1); + shutdown(sock_pair[1], SHUT_WR); + r = read(sock_pair[1], &c, 1); close(sock_pair[1]); close(sock_pair[0]); ha_free(&msg); -- 2.47.3