fstrim: make sure we use mnt_table_parse_fstab()
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
9717a162e0
commit
e062fa7554
|
@ -237,10 +237,16 @@ static int fstrim_all(struct fstrim_control *ctl)
|
|||
if (!itr)
|
||||
err(MNT_EX_FAIL, _("failed to initialize libmount iterator"));
|
||||
|
||||
if (ctl->fstab)
|
||||
filename = mnt_get_fstab_path();
|
||||
if (ctl->fstab) {
|
||||
tab = mnt_new_table();
|
||||
|
||||
if (tab && mnt_table_parse_fstab(tab, NULL) != 0) {
|
||||
mnt_unref_table(tab);
|
||||
tab = NULL;
|
||||
}
|
||||
} else
|
||||
tab = mnt_new_table_from_file(filename);
|
||||
|
||||
tab = mnt_new_table_from_file(filename);
|
||||
if (!tab)
|
||||
err(MNT_EX_FAIL, _("failed to parse %s"), filename);
|
||||
|
||||
|
|
Loading…
Reference in New Issue