findmnt: use scols_table_print_range() for --poll
This change fixes problem with duplicate header line. Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
7db029e54a
commit
c1d185c77b
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue