* 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
This commit is contained in:
Axel Dörfler 2010-06-13 16:52:21 +00:00
parent 05b7510980
commit 35f8d08009

View File

@ -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 <unistd.h>
#include <disk_device_manager/ddm_modules.h>
@ -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<void*>(disc);
result = 0.7;
} else