]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - misc/nstat.c
get rid of remaining -Wunused-result warnings
[mirror_iproute2.git] / misc / nstat.c
index 267e515ff987cf1e05b0612a67e3e7631a1f5bcb..99705286d279cb47d2a12a78fac23851a5f0082e 100644 (file)
@@ -649,7 +649,8 @@ int main(int argc, char *argv[])
                        }
                        if (uptime >= 0 && time(NULL) >= stb.st_mtime+uptime) {
                                fprintf(stderr, "nstat: history is aged out, resetting\n");
-                               ftruncate(fileno(hist_fp), 0);
+                               if (ftruncate(fileno(hist_fp), 0) < 0)
+                                       perror("nstat: ftruncate");
                        }
                }
 
@@ -693,7 +694,8 @@ int main(int argc, char *argv[])
                        dump_incr_db(stdout);
        }
        if (!no_update) {
-               ftruncate(fileno(hist_fp), 0);
+               if (ftruncate(fileno(hist_fp), 0) < 0)
+                       perror("nstat: ftruncate");
                rewind(hist_fp);
 
                json_output = 0;