From: Keith Wiles Date: Tue, 15 Aug 2017 13:53:05 +0000 (-0500) Subject: app/procinfo: fix compilation with -O3 X-Git-Tag: spdx-start~1721 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=535e850aedd8060ebc7c2c6c779d624a81b3548c;p=dpdk.git app/procinfo: fix compilation with -O3 When using EXTRA_CFLAGS="-g -O3" in the build the -O3 causes compiler warnings. Using Ubuntu 17.04 gcc compiler. Signed-off-by: Keith Wiles Acked-by: Anatoly Burakov --- diff --git a/app/proc_info/main.c b/app/proc_info/main.c index 8b753a2ee0..12566e27d9 100644 --- a/app/proc_info/main.c +++ b/app/proc_info/main.c @@ -524,7 +524,9 @@ nic_xstats_display(uint8_t port_id) sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%" PRIu64"\n", host_id, port_id, counter_type, xstats_names[i].name, values[i]); - write(stdout_fd, buf, strlen(buf)); + ret = write(stdout_fd, buf, strlen(buf)); + if (ret < 0) + goto err; } else { printf("%s: %"PRIu64"\n", xstats_names[i].name, values[i]);