|
Line
Link Here
|
| 0 |
-- mount/mount.c |
0 |
++ mount/mount.c |
|
Lines 665-670
Link Here
|
| 665 |
else { |
665 |
else { |
| 666 |
mntFILE *mfp; |
666 |
mntFILE *mfp; |
| 667 |
|
667 |
|
|
|
668 |
/* when moving a mount point, we have to make sure the mtab |
| 669 |
* gets updated properly. We get info about the old mount |
| 670 |
* point, copy it to the new mount point, and then delete |
| 671 |
* the old mount point. */ |
| 672 |
if (flags & MS_MOVE) { |
| 673 |
const char *olddir = mnt.mnt_fsname; |
| 674 |
struct mntentchn *oldmc = oldmc = getmntfile(olddir); |
| 675 |
if (oldmc != NULL) { |
| 676 |
mnt.mnt_fsname = strdup(oldmc->m.mnt_fsname); |
| 677 |
mnt.mnt_type = oldmc->m.mnt_type; |
| 678 |
mnt.mnt_opts = oldmc->m.mnt_opts; |
| 679 |
mnt.mnt_freq = oldmc->m.mnt_freq; |
| 680 |
mnt.mnt_passno = oldmc->m.mnt_passno; |
| 681 |
} |
| 682 |
update_mtab(olddir, NULL); |
| 683 |
if (oldmc != NULL) |
| 684 |
my_free(olddir); |
| 685 |
} |
| 686 |
|
| 668 |
lock_mtab(); |
687 |
lock_mtab(); |
| 669 |
mfp = my_setmntent(MOUNTED, "a+"); |
688 |
mfp = my_setmntent(MOUNTED, "a+"); |
| 670 |
if (mfp == NULL || mfp->mntent_fp == NULL) { |
689 |
if (mfp == NULL || mfp->mntent_fp == NULL) { |