Fixed the "Volume XXX is already mounted" warning with the -all{bfs|hfs|dos} options.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17103 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-04-12 11:16:39 +00:00
parent f88e467c8a
commit 71960e33b9
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. All rights reserved.
/*
* Copyright 2005-2006, Ingo Weinhold, bonefish@users.sf.net. All rights reserved.
* Distributed under the terms of the MIT License.
*/
@ -117,7 +117,7 @@ struct MountVisitor : public BDiskDeviceVisitor {
else if (!silent)
fprintf(stderr, "Volume `%s' already mounted.\n", name);
} else if (mountAll) {
mount = !partition->IsMounted();
mount = true;
} else if (mountBFS && type != NULL
&& strcmp(type, kPartitionTypeBFS) == 0) {
mount = true;
@ -130,6 +130,10 @@ struct MountVisitor : public BDiskDeviceVisitor {
mount = true;
}
// don't try to mount a partition twice
if (partition->IsMounted())
mount = false;
// check whether to unmount
bool unmount = false;
if (name && toUnmount.find(name) != toUnmount.end()) {