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:
Ingo Weinhold
2007-10-07 15:14:54 +00:00
parent dbef8fc452
commit 24ce374f61
@@ -430,23 +430,30 @@ BPrivate::DiskDevice::validate_initialize_partition(KPartition *partition,
status_t
BPrivate::DiskDevice::validate_create_child_partition(KPartition *partition,
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)
return B_BAD_VALUE;
// check the partition
status_t error = check_partition(partition, changeCounter, requireShadow);
if (error != B_OK)
return error;
// get the disk system
KDiskSystem *diskSystem = partition->DiskSystem();
if (!diskSystem)
return B_ENTRY_NOT_FOUND;
// get the info
int32 index;
if (diskSystem->ValidateCreateChild(partition, offset, size, type,
parameters, index)) {
parameters, &index)) {
if (_index)
*_index = index;
return B_OK;
}
return B_ERROR;
}