From 4cdd7099dc507cd30825aa29c3dda953f82287c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 30 Aug 2010 20:47:22 +0000 Subject: [PATCH] * Fixed a potential crash (partition may be NULL). This fixes CID 1544. * Added missing authors. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38462 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/mount/AutoMounter.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/servers/mount/AutoMounter.cpp b/src/servers/mount/AutoMounter.cpp index e14f5ea5fe..a6a6f810d8 100644 --- a/src/servers/mount/AutoMounter.cpp +++ b/src/servers/mount/AutoMounter.cpp @@ -1,6 +1,10 @@ /* * Copyright 2007-2010, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. + * + * Authors: + * Stephan Aßmus, superstippi@gmx.de + * Axel Dörfler, axeld@pinc-software.de */ @@ -409,8 +413,8 @@ suggest_mount_flags(const BPartition* partition, uint32* _flags) "unintentional data loss because of errors in Haiku."); } - BAlert* alert = new BAlert(B_TRANSLATE("Mount warning"), - string.String(), B_TRANSLATE("Mount read/write"), + BAlert* alert = new BAlert(B_TRANSLATE("Mount warning"), + string.String(), B_TRANSLATE("Mount read/write"), B_TRANSLATE("Cancel"), B_TRANSLATE("Mount read-only"), B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); alert->SetShortcut(1, B_ESCAPE); @@ -621,7 +625,7 @@ AutoMounter::_UnmountAndEjectVolume(BPartition* partition, BPath& mountPoint, else status = fs_unmount_volume(mountPoint.Path(), 0); - if (status < B_OK) { + if (status != B_OK) { if (!_SuggestForceUnmount(name, status)) return; @@ -631,8 +635,8 @@ AutoMounter::_UnmountAndEjectVolume(BPartition* partition, BPath& mountPoint, status = fs_unmount_volume(mountPoint.Path(), B_FORCE_UNMOUNT); } - if (status < B_OK) { - _ReportUnmountError(partition->ContentName(), status); + if (status != B_OK) { + _ReportUnmountError(name, status); return; }