]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix condition for mountinfo filter
authorKarel Zak <kzak@redhat.com>
Fri, 17 Jul 2020 08:45:40 +0000 (10:45 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 17 Jul 2020 08:45:40 +0000 (10:45 +0200)
The filter has to be used for valid entries.

References: fe0d12d4f82269096f8d0cffc51ca9590814c284
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_parse.c

index 4696053a116f5fe23ae4ca6f0febeb42d59b0a3b..fa2d31b81f9e8889eb26118f9d1b35d2843d34d9 100644 (file)
@@ -736,8 +736,8 @@ static int __table_parse_stream(struct libmnt_table *tb, FILE *f, const char *fi
                /* parse */
                rc = mnt_table_parse_next(&pa, tb, fs);
 
-               if (rc != 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
-                       rc = 1; /* error filtered out by callback... */
+               if (rc == 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
+                       rc = 1; /* filtered out by callback... */
 
                /* add to the table */
                if (rc == 0) {