Tracker and DriveSetup now attempt to clean up the mount point after successfully unmounting the volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26593 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -626,11 +626,14 @@ MainWindow::_Unmount(BDiskDevice* disk, partition_id selectedPartition)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (partition->IsMounted()) {
|
if (partition->IsMounted()) {
|
||||||
|
BPath path;
|
||||||
|
partition->GetMountPoint(&path);
|
||||||
status_t ret = partition->Unmount();
|
status_t ret = partition->Unmount();
|
||||||
if (ret < B_OK) {
|
if (ret < B_OK) {
|
||||||
_DisplayPartitionError("Could not unmount partition %s.",
|
_DisplayPartitionError("Could not unmount partition %s.",
|
||||||
partition, ret);
|
partition, ret);
|
||||||
} else {
|
} else {
|
||||||
|
rmdir(path.Path());
|
||||||
// successful unmount, adapt to the changes
|
// successful unmount, adapt to the changes
|
||||||
_ScanDrives();
|
_ScanDrives();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,18 +232,22 @@ AutoMounter::_UnmountAndEjectVolume(BMessage *message)
|
|||||||
BDiskDevice device;
|
BDiskDevice device;
|
||||||
if (roster.GetPartitionWithID(id, &device, &partition) != B_OK)
|
if (roster.GetPartitionWithID(id, &device, &partition) != B_OK)
|
||||||
return;
|
return;
|
||||||
|
BPath path;
|
||||||
|
if (partition->GetMountPoint(&path) == B_OK)
|
||||||
|
{
|
||||||
|
status_t status = partition->Unmount();
|
||||||
|
if (status < B_OK) {
|
||||||
|
if (!_ForceUnmount(partition->ContentName(), status))
|
||||||
|
return;
|
||||||
|
|
||||||
status_t status = partition->Unmount();
|
status = partition->Unmount(B_FORCE_UNMOUNT);
|
||||||
if (status < B_OK) {
|
}
|
||||||
if (!_ForceUnmount(partition->ContentName(), status))
|
|
||||||
return;
|
|
||||||
|
|
||||||
status = partition->Unmount(B_FORCE_UNMOUNT);
|
if (status < B_OK)
|
||||||
|
_ReportUnmountError(partition->ContentName(), status);
|
||||||
|
|
||||||
|
rmdir(path.Path());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status < B_OK)
|
|
||||||
_ReportUnmountError(partition->ContentName(), status);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user