Signed-off-by: Karel Zak <kzak@redhat.com>
mc->nxt->prev = mc->prev;
free(mc);
}
- } else {
+ } else if (!strcmp(mc->m.mnt_dir, instead->mnt_dir)) {
/* A remount */
mc->m.mnt_opts = instead->mnt_opts;
+ } else {
+ /* A move */
+ my_free(mc->m.mnt_dir);
+ mc->m.mnt_dir = xstrdup(instead->mnt_dir);
}
} else if (instead) {
/* not found, add a new entry */
mnt.mnt_opts = opts;
mnt.mnt_freq = freq;
mnt.mnt_passno = pass;
-
+
/* We get chatty now rather than after the update to mtab since the
mount succeeded, even if the write to /etc/mtab should fail. */
if (verbose)
if (!nomtab && mtab_is_writable()) {
if (flags & MS_REMOUNT)
update_mtab (mnt.mnt_dir, &mnt);
+ else if (flags & MS_MOVE)
+ update_mtab(mnt.mnt_fsname, &mnt);
else {
mntFILE *mfp;