Skip to content

Commit ffdccb6

Browse files
committed
BUILD: mworker: fix ignoring return value of ‘read’
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.
1 parent 7232677 commit ffdccb6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/haproxy.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3591,6 +3591,7 @@ int main(int argc, char **argv)
35913591
int sock_pair[2];
35923592
char *msg = NULL;
35933593
char c;
3594+
int r __maybe_unused;
35943595

35953596
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sock_pair) == -1) {
35963597
ha_alert("[%s.main()] Cannot create socketpair to update the new worker state\n",
@@ -3626,8 +3627,8 @@ int main(int argc, char **argv)
36263627
* after confirming receipt of the "\n" from the CLI applet, so
36273628
* we make sure that the fd is received correctly.
36283629
*/
3629-
shutdown(sock_pair[1], SHUT_WR);
3630-
read(sock_pair[1], &c, 1);
3630+
shutdown(sock_pair[1], SHUT_WR);
3631+
r = read(sock_pair[1], &c, 1);
36313632
close(sock_pair[1]);
36323633
close(sock_pair[0]);
36333634
ha_free(&msg);

0 commit comments

Comments
 (0)