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
This commit is contained in:
Andreas Färber
2010-06-27 15:17:59 +00:00
parent 3d00bd66b8
commit b62981b983
@@ -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;
}