From: Bruce Richardson Date: Thu, 7 Sep 2017 13:09:23 +0000 (+0100) Subject: cmdline: fix warning for unused return value X-Git-Tag: spdx-start~2136 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0a10db80bca3262977646f814e913f4af0b627cc;p=dpdk.git cmdline: fix warning for unused return value When DPDK is compiled on Ubuntu with extra warnings turned on, there is a warning about the return value from write() being unchecked. Rather than having builds disable the warning, which may mask other cases we do care about, we can add a dummy use of the return value in the code to silence it in this instance. Signed-off-by: Bruce Richardson Acked-by: Olivier Matz Acked-by: Harry van Haaren --- diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c index a9c47be3c9..d749165155 100644 --- a/lib/librte_cmdline/cmdline.c +++ b/lib/librte_cmdline/cmdline.c @@ -205,7 +205,8 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...) } if (ret >= BUFSIZ) ret = BUFSIZ - 1; - write(cl->s_out, buf, ret); + ret = write(cl->s_out, buf, ret); + (void)ret; free(buf); #endif }