* Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38416 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1265,18 +1265,19 @@ Inode::AddAttribute(Attribute* attribute, bool overwrite)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Inode::AddAttribute(const char* name, type_code type,
|
Inode::AddAttribute(const char* name, type_code type, bool overwrite,
|
||||||
bool overwrite, const uint8* data, size_t length)
|
const uint8* data, size_t length)
|
||||||
{
|
{
|
||||||
Attribute* attribute = new Attribute(name, type);
|
Attribute* attribute = new Attribute(name, type);
|
||||||
status_t status = attribute != NULL ? B_OK : B_NO_MEMORY;
|
if (attribute == NULL)
|
||||||
if (status == B_OK)
|
return B_NO_MEMORY;
|
||||||
status = attribute->InitCheck();
|
|
||||||
|
status_t status = attribute->InitCheck();
|
||||||
if (status == B_OK && data != NULL && length != 0)
|
if (status == B_OK && data != NULL && length != 0)
|
||||||
status = attribute->WriteAt(0, data, &length);
|
status = attribute->WriteAt(0, data, &length);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = AddAttribute(attribute, overwrite);
|
status = AddAttribute(attribute, overwrite);
|
||||||
if (status < B_OK) {
|
if (status != B_OK) {
|
||||||
delete attribute;
|
delete attribute;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user