From: Karel Zak Date: Wed, 24 Feb 2016 11:04:24 +0000 (+0100) Subject: findmnt: use scols_table_print_range() for --poll X-Git-Tag: v2.28-rc1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d185c77b8bb4c41c73896b685b01e304569a9e;p=thirdparty%2Futil-linux.git findmnt: use scols_table_print_range() for --poll This change fixes problem with duplicate header line. Signed-off-by: Karel Zak --- diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index dd84671dcc..f72be14b9e 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);