From 71960e33b97b2b7dc1ada016cfa09adf2469ea77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 12 Apr 2006 11:16:39 +0000 Subject: [PATCH] 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 --- src/bin/mountvolume.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/mountvolume.cpp b/src/bin/mountvolume.cpp index d8ccf3d31d..0afca6c450 100644 --- a/src/bin/mountvolume.cpp +++ b/src/bin/mountvolume.cpp @@ -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()) {