From e4b4a99228bcfeb017ba8a6527f4d565f2303385 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 20 Jan 2006 14:49:16 +0000 Subject: [PATCH] Update the BDiskDevice object after mounting/unmounting a partition. Untested, but should fix bug #92. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16012 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Partition.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/kits/storage/Partition.cpp b/src/kits/storage/Partition.cpp index 5209072186..4bb1880dae 100644 --- a/src/kits/storage/Partition.cpp +++ b/src/kits/storage/Partition.cpp @@ -516,6 +516,10 @@ BPartition::Mount(const char *mountPoint, uint32 mountFlags, if (device < B_OK && deleteMountPoint) rmdir(mountPoint); + // update object, if successful + if (device >= 0) + error = Device()->Update(); + return device; } @@ -543,7 +547,13 @@ BPartition::Unmount(uint32 unmountFlags) return error; // unmount - return fs_unmount_volume(partitionPath.Path(), unmountFlags); + error = fs_unmount_volume(partitionPath.Path(), unmountFlags); + + // update object, if successful + if (error == B_OK) + error = Device()->Update(); + + return error; } // Device