mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
- Fix ntfsresize to unmount the volume when finished/exiting so it does
not leave the volume in an inconsistent state. Somewhat crude solution using atexit() but it works... (Anton)
This commit is contained in:
parent
5302d23f7b
commit
a32aa26d0b
@ -84,6 +84,12 @@ xx/xx/2006 - x.xx.x - .
|
||||
- Set the volume dirty bit at mount time (if it is not set already and
|
||||
clear it again at umount time but only if it was not set to start
|
||||
with. (Anton)
|
||||
- Introduce NTFS_MNT_FORENSIC mount option for logfile dumping for
|
||||
example otherwise the logfile gets wiped out by the mount attempt if
|
||||
it is not read-only. (Anton)
|
||||
- Fix ntfsresize to unmount the volume when finished/exiting so it does
|
||||
not leave the volume in an inconsistent state. Somewhat crude
|
||||
solution using atexit() but it works... (Anton)
|
||||
|
||||
21/06/2006 - 1.13.1 - Various fixes.
|
||||
|
||||
|
@ -2359,6 +2359,13 @@ static void check_cluster_allocation(ntfs_volume *vol, ntfsck_t *fsck)
|
||||
compare_bitmaps(vol, &fsck->lcn_bitmap);
|
||||
}
|
||||
|
||||
static ntfs_volume *g_vol;
|
||||
|
||||
static void ntfsresize_atexit(void) {
|
||||
if (g_vol && ntfs_umount(g_vol, 0) < 0)
|
||||
perror("Failed to unmount volume");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ntfsck_t fsck;
|
||||
@ -2377,8 +2384,12 @@ int main(int argc, char **argv)
|
||||
|
||||
utils_set_locale();
|
||||
|
||||
if ((vol = mount_volume()) == NULL)
|
||||
g_vol = NULL;
|
||||
if (atexit(ntfsresize_atexit))
|
||||
err_exit("Failed to register exit handler!");
|
||||
if (!(vol = mount_volume()))
|
||||
err_exit("Couldn't open volume '%s'!\n", opt.volume);
|
||||
g_vol = vol;
|
||||
|
||||
device_size = ntfs_device_size_get(vol->dev, vol->sector_size);
|
||||
device_size *= vol->sector_size;
|
||||
|
Loading…
Reference in New Issue
Block a user