From 2cbe2e7f84a680f30383c2fee38577091e4394a9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 22 Jan 2021 15:58:26 +0100 Subject: [PATCH] BUILD: debug: fix build warning by consuming the write() result When writing commit a8459b28c ("MINOR: debug: create ha_backtrace_to_stderr() to dump an instant backtrace") I just forgot that some distros are a bit extremist about the syscall return values. src/debug.c: In function `ha_backtrace_to_stderr': src/debug.c:147:3: error: ignoring return value of `write', declared with attribute warn_unused_result [-Werror=unused-result] write(2, b.area, b.data); ^~~~~~~~~~~~~~~~~~~~~~~~ CC src/h1_htx.o Let's apply the usual tricks to shut them up. No backport is needed. --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index fc2de92f0..bf64f19f0 100644 --- a/src/debug.c +++ b/src/debug.c @@ -144,7 +144,7 @@ void ha_backtrace_to_stderr() ha_dump_backtrace(&b, " ", 4); if (b.data) - write(2, b.area, b.data); + DISGUISE(write(2, b.area, b.data)); } /* Dumps to the buffer some known information for the desired thread, and