From 35f8d080097947be245f0fd135c9fff4122b929e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 13 Jun 2010 16:52:21 +0000 Subject: [PATCH] * Fixed the good old operator& precedence bug I noticed while looking over a patch by Ziusudra. * Use new(std::nothrow) instead of new. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37126 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/partitioning_systems/session/session.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/partitioning_systems/session/session.cpp b/src/add-ons/kernel/partitioning_systems/session/session.cpp index 501d3b49fd..3b9a46d0a1 100644 --- a/src/add-ons/kernel/partitioning_systems/session/session.cpp +++ b/src/add-ons/kernel/partitioning_systems/session/session.cpp @@ -3,11 +3,12 @@ * Distributed under the terms of the MIT License. */ -/*! - \file session.cpp + +/*! \file session.cpp \brief Disk device manager partition module for CD/DVD sessions. */ + #include #include @@ -45,12 +46,12 @@ identify_partition(int fd, partition_data *partition, void **cookie) device_geometry geometry; float result = -1; - if (partition->flags & B_PARTITION_IS_DEVICE + if ((partition->flags & B_PARTITION_IS_DEVICE) != 0 && partition->block_size == 2048 && ioctl(fd, B_GET_GEOMETRY, &geometry) == 0 && geometry.device_type == B_CD) { - Disc *disc = new Disc(fd); - if (disc && disc->InitCheck() == B_OK) { + Disc *disc = new(std::nothrow) Disc(fd); + if (disc != NULL && disc->InitCheck() == B_OK) { *cookie = static_cast(disc); result = 0.7; } else