See https://github.com/systemd/systemd/pull/12218#pullrequestreview-
226029985.
if (!table || !iter)
return -ENOMEM;
+ /* If source or path are specified, we use on the functions which ignore utab.
+ * Only if both are empty, we use mnt_table_parse_mtab(). */
+
if (source)
r = mnt_table_parse_stream(table, source, path);
+ else if (path)
+ r = mnt_table_parse_file(table, path);
else
- r = mnt_table_parse_mtab(table, path);
+ r = mnt_table_parse_mtab(table, NULL);
if (r < 0)
return r;
again = false;
- r = libmount_parse(NULL, NULL, &table, &iter);
+ r = libmount_parse("/proc/self/mountinfo", NULL, &table, &iter);
if (r < 0)
return log_debug_errno(r, "Failed to parse /proc/self/mountinfo: %m");