From 429f245650a772c3df5691055708b5d13b0c96ef Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 13 Nov 2008 15:40:38 +0000 Subject: [PATCH] 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 --- src/add-ons/kernel/bus_managers/acpi/acpi_busman.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c index 0086ad6720..a67dee48dd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -380,6 +380,9 @@ evaluate_object(const char* object, acpi_object_type* returnValue, status = AcpiEvaluateObject(NULL, (ACPI_STRING)object, 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; } @@ -405,6 +408,9 @@ evaluate_method(const char* object, const char* method, status = AcpiEvaluateObject(handle, (ACPI_STRING)method, 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; }