diff --git a/src/kits/storage/Partition.cpp b/src/kits/storage/Partition.cpp index 4bb1880dae..00721921ec 100644 --- a/src/kits/storage/Partition.cpp +++ b/src/kits/storage/Partition.cpp @@ -1,12 +1,14 @@ -//---------------------------------------------------------------------- -// This software is part of the Haiku distribution and is covered -// by the MIT license. -//--------------------------------------------------------------------- +/* + * Copyright 2003-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish@cs.tu-berlin.de + */ -#include -#include -#include -#include + +#include +#include #include #include @@ -21,8 +23,11 @@ #include #include -#include -#include +#include +#include +#include +#include + using std::nothrow; @@ -537,23 +542,23 @@ BPartition::Mount(const char *mountPoint, uint32 mountFlags, status_t BPartition::Unmount(uint32 unmountFlags) { - if (!fPartitionData || !IsMounted()) + if (fPartitionData == NULL || !IsMounted()) return B_BAD_VALUE; // get the partition path - BPath partitionPath; - status_t error = GetPath(&partitionPath); - if (error != B_OK) - return error; + BPath path; + status_t status = GetMountPoint(&path); + if (status != B_OK) + return status; // unmount - error = fs_unmount_volume(partitionPath.Path(), unmountFlags); + status = fs_unmount_volume(path.Path(), unmountFlags); // update object, if successful - if (error == B_OK) - error = Device()->Update(); + if (status == B_OK) + status = Device()->Update(); - return error; + return status; } // Device