mirror of
https://github.com/utmapp/libusb.git
synced 2026-12-01 07:43:16 -10:00
Some functions were returning e.g. -ENOMEM and the caller would check for negative return values. However, on Haiku, contrary to modern standards, these macros are negative, so this logic would fail. In any case, change the function to return -1 instead. For good measure also set errno to the appropriate value, although it is not used in the current code. This was discovered on Haiku builds because the value for ENOMEM is INT_MIN which cannot be negated without overflow. Signed-off-by: Tormod Volden <[email protected]>