The current solution is to use /proc/mounts if previous attempt to
open /proc/self/mountinfo failed. The fallback should not be used when
mount table path is explicitly specified by application. The default
is NULL, only in this case libmount should be try to be smart.
Reported-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
struct libmnt_table *u_tb)
{
int rc = 0, priv_utab = 0;
+ int explicit_file = filename ? 1 : 0;
assert(tb);
rc = mnt_table_parse_file(tb, filename);
if (rc) {
+ if (explicit_file)
+ return rc;
+
/* hmm, old kernel? ...try /proc/mounts */
tb->fmt = MNT_FMT_MTAB;
return mnt_table_parse_file(tb, _PATH_PROC_MOUNTS);