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:
parent
f587c66c57
commit
5c4fff2ef1
@ -626,11 +626,14 @@ MainWindow::_Unmount(BDiskDevice* disk, partition_id selectedPartition)
|
||||
}
|
||||
|
||||
if (partition->IsMounted()) {
|
||||
BPath path;
|
||||
partition->GetMountPoint(&path);
|
||||
status_t ret = partition->Unmount();
|
||||
if (ret < B_OK) {
|
||||
_DisplayPartitionError("Could not unmount partition %s.",
|
||||
partition, ret);
|
||||
} else {
|
||||
rmdir(path.Path());
|
||||
// successful unmount, adapt to the changes
|
||||
_ScanDrives();
|
||||
}
|
||||
|
@ -232,18 +232,22 @@ AutoMounter::_UnmountAndEjectVolume(BMessage *message)
|
||||
BDiskDevice device;
|
||||
if (roster.GetPartitionWithID(id, &device, &partition) != B_OK)
|
||||
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();
|
||||
if (status < B_OK) {
|
||||
if (!_ForceUnmount(partition->ContentName(), status))
|
||||
return;
|
||||
status = partition->Unmount(B_FORCE_UNMOUNT);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user