]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fincore: remove unused variable [clang scan]
authorKarel Zak <kzak@redhat.com>
Thu, 16 May 2019 12:27:15 +0000 (14:27 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 May 2019 12:27:15 +0000 (14:27 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/fincore.c

index 0fb1a759a0f66f51a0af4768e37bca25c01cd387..03ff4d154f87572382a1ac341d63aab429d68780 100644 (file)
@@ -196,7 +196,6 @@ static int fincore_fd (struct fincore_control *ctl,
        size_t window_size = N_PAGES_IN_WINDOW * ctl->pagesize;
        off_t file_offset, len;
        int rc = 0;
-       int warned_once = 0;
 
        for (file_offset = 0; file_offset < file_size; file_offset += len) {
                void  *window = NULL;
@@ -207,11 +206,8 @@ static int fincore_fd (struct fincore_control *ctl,
 
                window = mmap(window, len, PROT_NONE, MAP_PRIVATE, fd, file_offset);
                if (window == MAP_FAILED) {
-                       if (!warned_once) {
-                               rc = -EINVAL;
-                               warn(_("failed to do mmap: %s"), name);
-                               warned_once = 1;
-                       }
+                       rc = -EINVAL;
+                       warn(_("failed to do mmap: %s"), name);
                        break;
                }