log an error in case the passed buffer is too small. This happens with the acpi_thermal driver and also with the acpi_battery driver by Francesco Piccinno (not yet committed), but it's a design flaw of the api

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28638 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2008-11-13 15:40:38 +00:00
parent e35981a931
commit 429f245650

View File

@ -380,6 +380,9 @@ evaluate_object(const char* object, acpi_object_type* returnValue,
status = AcpiEvaluateObject(NULL, (ACPI_STRING)object, NULL, status = AcpiEvaluateObject(NULL, (ACPI_STRING)object, NULL,
returnValue != NULL ? &buffer : NULL); returnValue != NULL ? &buffer : NULL);
if (status == AE_BUFFER_OVERFLOW)
dprintf("evaluate_object: the passed buffer is too small!\n");
return status == AE_OK ? B_OK : B_ERROR; return status == AE_OK ? B_OK : B_ERROR;
} }
@ -405,6 +408,9 @@ evaluate_method(const char* object, const char* method,
status = AcpiEvaluateObject(handle, (ACPI_STRING)method, status = AcpiEvaluateObject(handle, (ACPI_STRING)method,
args != NULL ? &acpiArgs : NULL, returnValue != NULL ? &buffer : NULL); args != NULL ? &acpiArgs : NULL, returnValue != NULL ? &buffer : NULL);
if (status == AE_BUFFER_OVERFLOW)
dprintf("evaluate_method: the passed buffer is too small!\n");
return status == AE_OK ? B_OK : B_ERROR; return status == AE_OK ? B_OK : B_ERROR;
} }