The index parameter to validate_create_child_partition() is optional,
but it is mandatory to the KDiskSystem::ValidateCreateChild(), which is invoked, so we need to use a stack variable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22473 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -430,23 +430,30 @@ BPrivate::DiskDevice::validate_initialize_partition(KPartition *partition,
|
|||||||
status_t
|
status_t
|
||||||
BPrivate::DiskDevice::validate_create_child_partition(KPartition *partition,
|
BPrivate::DiskDevice::validate_create_child_partition(KPartition *partition,
|
||||||
int32 changeCounter, off_t *offset, off_t *size, const char *type,
|
int32 changeCounter, off_t *offset, off_t *size, const char *type,
|
||||||
const char *parameters, int32 *index, bool requireShadow)
|
const char *parameters, int32 *_index, bool requireShadow)
|
||||||
{
|
{
|
||||||
if (!partition || !offset || !size || !type)
|
if (!partition || !offset || !size || !type)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
// check the partition
|
// check the partition
|
||||||
status_t error = check_partition(partition, changeCounter, requireShadow);
|
status_t error = check_partition(partition, changeCounter, requireShadow);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
// get the disk system
|
// get the disk system
|
||||||
KDiskSystem *diskSystem = partition->DiskSystem();
|
KDiskSystem *diskSystem = partition->DiskSystem();
|
||||||
if (!diskSystem)
|
if (!diskSystem)
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
// get the info
|
// get the info
|
||||||
|
int32 index;
|
||||||
if (diskSystem->ValidateCreateChild(partition, offset, size, type,
|
if (diskSystem->ValidateCreateChild(partition, offset, size, type,
|
||||||
parameters, index)) {
|
parameters, &index)) {
|
||||||
|
if (_index)
|
||||||
|
*_index = index;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user