summaryrefslogtreecommitdiffstats
path: root/misc-utils/findmnt.c
diff options
context:
space:
mode:
authorKarel Zak2016-02-24 12:04:24 +0100
committerKarel Zak2016-02-24 12:04:24 +0100
commitc1d185c77b8bb4c41c73896b685b01e304569a9e (patch)
treeef10dad8dc9f78a906d9a088ae13468b4d19a4b4 /misc-utils/findmnt.c
parentlogger: always update header when writing stdin line (diff)
downloadkernel-qcow2-util-linux-c1d185c77b8bb4c41c73896b685b01e304569a9e.tar.gz
kernel-qcow2-util-linux-c1d185c77b8bb4c41c73896b685b01e304569a9e.tar.xz
kernel-qcow2-util-linux-c1d185c77b8bb4c41c73896b685b01e304569a9e.zip
findmnt: use scols_table_print_range() for --poll
This change fixes problem with duplicate header line. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/findmnt.c')
-rw-r--r--misc-utils/findmnt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index dd84671dc..f72be14b9 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -1165,7 +1165,7 @@ static int poll_table(struct libmnt_table *tb, const char *tabfile,
}
if (count) {
- rc = scols_print_table(table);
+ rc = scols_table_print_range(table, NULL, NULL);
if (rc)
goto done;
}
@@ -1175,6 +1175,7 @@ static int poll_table(struct libmnt_table *tb, const char *tabfile,
tb = tb_new;
tb_new = tmp;
+ /* remove allredy printed lines to reduce memory usage */
scols_table_remove_lines(table);
mnt_reset_table(tb_new);