oh_compare_sensorreading() should return +1/0/-1 depending whether first parameter is greater than, equal to or less than the second parameter. In case of SAHPI_SENSOR_READING_TYPE_BUFFER the memcmp() function is used. The standard for memcmp() says that the result is "an integer less than, equal to, or greater than zero" and it really can take other values than +1/0/-1, an example is the System z from IBM (s390/s390x) that can do the memcmp operation using one machine code instruction.
related glibc "bug" - https://bugzilla.redhat.com/show_bug.cgi?id=494317
Shuah Khan
OpenHPI base library
2.14.0
Public
|
Date: 2009-04-06 11:58:01 PDT Applied patches attched to the defect. |
| Filename | Description | Download |
|---|---|---|
| 0001-fix-wrong-usage-memcmp.patch | fix wrong memcmp usage | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-04-06 11:58:02 PDT | shuah |
| resolution_id | None | 2009-04-06 11:58:02 PDT | shuah |
| assigned_to | nobody | 2009-04-06 11:58:02 PDT | shuah |
| allow_comments | 1 | 2009-04-06 11:58:02 PDT | shuah |
| close_date | - | 2009-04-06 11:58:02 PDT | shuah |
| File Added | 321500: 0001-fix-wrong-usage-memcmp.patch | 2009-04-06 06:37:06 PDT | horakdan |