Aesthetical changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22467 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -67,24 +67,28 @@ status_t
|
|||||||
BPartitioningInfo::_SetTo(partition_id partition, int32 changeCounter)
|
BPartitioningInfo::_SetTo(partition_id partition, int32 changeCounter)
|
||||||
{
|
{
|
||||||
Unset();
|
Unset();
|
||||||
|
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
partitionable_space_data *buffer = NULL;
|
partitionable_space_data* buffer = NULL;
|
||||||
int32 count = 0;
|
int32 count = 0;
|
||||||
int32 actualCount = 0;
|
int32 actualCount = 0;
|
||||||
do {
|
while (true) {
|
||||||
error = _kern_get_partitionable_spaces(partition, changeCounter,
|
error = _kern_get_partitionable_spaces(partition, changeCounter,
|
||||||
buffer, count, &actualCount);
|
buffer, count, &actualCount);
|
||||||
if (error == B_BUFFER_OVERFLOW) {
|
if (error != B_BUFFER_OVERFLOW)
|
||||||
// buffer to small re-allocate it
|
break;
|
||||||
if (buffer)
|
|
||||||
delete[] buffer;
|
// buffer too small re-allocate it
|
||||||
buffer = new(nothrow) partitionable_space_data[actualCount];
|
delete[] buffer;
|
||||||
if (buffer)
|
buffer = new(nothrow) partitionable_space_data[actualCount];
|
||||||
count = actualCount;
|
if (!buffer) {
|
||||||
else
|
error = B_NO_MEMORY;
|
||||||
error = B_NO_MEMORY;
|
break;
|
||||||
}
|
}
|
||||||
} while (error == B_BUFFER_OVERFLOW);
|
|
||||||
|
count = actualCount;
|
||||||
|
}
|
||||||
|
|
||||||
// set data / cleanup on failure
|
// set data / cleanup on failure
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
fPartitionID = partition;
|
fPartitionID = partition;
|
||||||
@@ -92,6 +96,7 @@ BPartitioningInfo::_SetTo(partition_id partition, int32 changeCounter)
|
|||||||
fCount = actualCount;
|
fCount = actualCount;
|
||||||
} else if (buffer)
|
} else if (buffer)
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user