From b62981b983166e048ce049de8405875f148af6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 27 Jun 2010 15:17:59 +0000 Subject: [PATCH] OpenFirmware: Make of_milliseconds() return error The only user of of_milliseconds(), the boot loader's system_time(), checks for an error that would never be signalled since the zero-initialized number of milliseconds would always be returned. Return OF_FAILED instead to allow explicit error handling in that case. While this is a behavioral change, it is not yet a functional change, for system_time()'s implementation translates OF_FAILED back to zero currently. Resolves part of ticket #6061. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37279 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/platform/openfirmware/openfirmware.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/platform/openfirmware/openfirmware.cpp b/src/system/kernel/platform/openfirmware/openfirmware.cpp index 8c0f7e06e5..1f1d997496 100644 --- a/src/system/kernel/platform/openfirmware/openfirmware.cpp +++ b/src/system/kernel/platform/openfirmware/openfirmware.cpp @@ -559,7 +559,8 @@ of_milliseconds(void) int milliseconds; } args = {"milliseconds", 0, 1, 0}; - gCallOpenFirmware(&args); + if (gCallOpenFirmware(&args) == OF_FAILED) + return OF_FAILED; return args.milliseconds; }