app/procinfo: fix compilation with -O3
authorKeith Wiles <keith.wiles@intel.com>
Tue, 15 Aug 2017 13:53:05 +0000 (08:53 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 6 Oct 2017 21:53:56 +0000 (23:53 +0200)
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 <keith.wiles@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
app/proc_info/main.c

index 8b753a2..12566e2 100644 (file)
@@ -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]);