Made disk device type strings B_FILE_NAME_LENGTH long, and fixed

a few partition name constants that hadn't been changed from B_OS_NAME_LENGTH.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5179 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder
2003-10-27 22:45:15 +00:00
parent e176a055ac
commit 937144690c
@@ -918,8 +918,8 @@ _kern_validate_set_partition_type(partition_id partitionID,
{ {
if (!_type) if (!_type)
return B_BAD_VALUE; return B_BAD_VALUE;
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
status_t error = ddm_strlcpy(type, _type, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(type, _type, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager *manager = KDiskDeviceManager::Default();
@@ -990,11 +990,11 @@ _kern_validate_create_child_partition(partition_id partitionID,
} }
off_t offset; off_t offset;
off_t size; off_t size;
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
char *parameters = NULL; char *parameters = NULL;
user_memcpy(&offset, _offset, sizeof(offset)); user_memcpy(&offset, _offset, sizeof(offset));
user_memcpy(&size, _size, sizeof(size)); user_memcpy(&size, _size, sizeof(size));
status_t error = ddm_strlcpy(type, _type, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(type, _type, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
if (_parameters) { if (_parameters) {
@@ -1048,10 +1048,10 @@ _kern_get_next_supported_partition_type(partition_id partitionID,
error = diskSystem ? B_OK : B_ENTRY_NOT_FOUND; error = diskSystem ? B_OK : B_ENTRY_NOT_FOUND;
if (!error) { if (!error) {
// get the info // get the info
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
error = diskSystem->GetNextSupportedType(partition, &cookie, type); error = diskSystem->GetNextSupportedType(partition, &cookie, type);
if (!error) { if (!error) {
error = ddm_strlcpy(_type, type, B_OS_NAME_LENGTH); error = ddm_strlcpy(_type, type, B_FILE_NAME_LENGTH);
} }
} }
} }
@@ -1068,8 +1068,8 @@ _kern_get_partition_type_for_content_type(disk_system_id diskSystemID,
{ {
if (!_contentType || !_type) if (!_contentType || !_type)
return B_BAD_VALUE; return B_BAD_VALUE;
char contentType[B_OS_NAME_LENGTH]; char contentType[B_FILE_NAME_LENGTH];
status_t error = ddm_strlcpy(contentType, _contentType, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(contentType, _contentType, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager *manager = KDiskDeviceManager::Default();
@@ -1079,9 +1079,9 @@ _kern_get_partition_type_for_content_type(disk_system_id diskSystemID,
return false; return false;
DiskSystemLoader loader(diskSystem, true); DiskSystemLoader loader(diskSystem, true);
// get the info // get the info
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
if (diskSystem->GetTypeForContentType(contentType, type)) { if (diskSystem->GetTypeForContentType(contentType, type)) {
return ddm_strlcpy(_type, type, B_OS_NAME_LENGTH); return ddm_strlcpy(_type, type, B_FILE_NAME_LENGTH);
} }
return B_ERROR; return B_ERROR;
} }
@@ -1303,7 +1303,7 @@ _kern_set_partition_name(partition_id partitionID, int32 changeCounter,
{ {
if (!_name) if (!_name)
return B_BAD_VALUE; return B_BAD_VALUE;
char name[B_OS_NAME_LENGTH]; char name[B_FILE_NAME_LENGTH];
status_t error = ddm_strlcpy(name, _name, B_FILE_NAME_LENGTH); status_t error = ddm_strlcpy(name, _name, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
@@ -1316,7 +1316,7 @@ _kern_set_partition_name(partition_id partitionID, int32 changeCounter,
PartitionRegistrar registrar2(partition->Device(), true); PartitionRegistrar registrar2(partition->Device(), true);
DeviceWriteLocker locker(partition->Device(), true); DeviceWriteLocker locker(partition->Device(), true);
// check name // check name
char proposedName[B_OS_NAME_LENGTH]; char proposedName[B_FILE_NAME_LENGTH];
strcpy(proposedName, name); strcpy(proposedName, name);
error = validate_set_partition_name(partition, changeCounter, error = validate_set_partition_name(partition, changeCounter,
proposedName); proposedName);
@@ -1341,7 +1341,7 @@ _kern_set_partition_content_name(partition_id partitionID, int32 changeCounter,
{ {
if (!_name) if (!_name)
return B_BAD_VALUE; return B_BAD_VALUE;
char name[B_OS_NAME_LENGTH]; char name[B_FILE_NAME_LENGTH];
status_t error = ddm_strlcpy(name, _name, B_FILE_NAME_LENGTH); status_t error = ddm_strlcpy(name, _name, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
@@ -1354,7 +1354,7 @@ _kern_set_partition_content_name(partition_id partitionID, int32 changeCounter,
PartitionRegistrar registrar2(partition->Device(), true); PartitionRegistrar registrar2(partition->Device(), true);
DeviceWriteLocker locker(partition->Device(), true); DeviceWriteLocker locker(partition->Device(), true);
// check name // check name
char proposedName[B_OS_NAME_LENGTH]; char proposedName[B_FILE_NAME_LENGTH];
strcpy(proposedName, name); strcpy(proposedName, name);
error = validate_set_partition_content_name(partition, error = validate_set_partition_content_name(partition,
changeCounter, proposedName); changeCounter, proposedName);
@@ -1379,8 +1379,8 @@ _kern_set_partition_type(partition_id partitionID, int32 changeCounter,
{ {
if (!_type) if (!_type)
return B_BAD_VALUE; return B_BAD_VALUE;
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
status_t error = ddm_strlcpy(type, _type, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(type, _type, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager *manager = KDiskDeviceManager::Default();
@@ -1499,7 +1499,7 @@ _kern_initialize_partition(partition_id partitionID, int32 changeCounter,
if (!_diskSystemName || !_name || parametersSize > B_DISK_DEVICE_MAX_PARAMETER_SIZE) if (!_diskSystemName || !_name || parametersSize > B_DISK_DEVICE_MAX_PARAMETER_SIZE)
return B_BAD_VALUE; return B_BAD_VALUE;
char diskSystemName[B_OS_NAME_LENGTH]; char diskSystemName[B_OS_NAME_LENGTH];
char name[B_OS_NAME_LENGTH]; char name[B_FILE_NAME_LENGTH];
char *parameters = NULL; char *parameters = NULL;
status_t error = ddm_strlcpy(diskSystemName, _diskSystemName, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(diskSystemName, _diskSystemName, B_OS_NAME_LENGTH);
if (!error) if (!error)
@@ -1527,7 +1527,7 @@ _kern_initialize_partition(partition_id partitionID, int32 changeCounter,
if (!error) { if (!error) {
DiskSystemLoader loader(diskSystem, true); DiskSystemLoader loader(diskSystem, true);
// check parameters // check parameters
char proposedName[B_OS_NAME_LENGTH]; char proposedName[B_FILE_NAME_LENGTH];
strcpy(proposedName, name); strcpy(proposedName, name);
error = validate_initialize_partition(partition, changeCounter, error = validate_initialize_partition(partition, changeCounter,
diskSystemName, proposedName, parameters); diskSystemName, proposedName, parameters);
@@ -1583,9 +1583,9 @@ _kern_create_child_partition(partition_id partitionID, int32 changeCounter,
{ {
if (!_type || parametersSize > B_DISK_DEVICE_MAX_PARAMETER_SIZE) if (!_type || parametersSize > B_DISK_DEVICE_MAX_PARAMETER_SIZE)
return B_BAD_VALUE; return B_BAD_VALUE;
char type[B_OS_NAME_LENGTH]; char type[B_FILE_NAME_LENGTH];
char *parameters = NULL; char *parameters = NULL;
status_t error = ddm_strlcpy(type, _type, B_OS_NAME_LENGTH); status_t error = ddm_strlcpy(type, _type, B_FILE_NAME_LENGTH);
if (error) if (error)
return error; return error;
if (_parameters) { if (_parameters) {