HomeFreeBSD

login_cap.c: Don't set errno to ERANGE on memory allocation failure

Description

login_cap.c: Don't set errno to ERANGE on memory allocation failure

Modified functions: login_getcaptime(), login_getcapnum(),
login_getcapsize().

They all call cgetstr(), which returns -2 on such conditions and already
sets errno to ENOMEM, arguably the appropriate value for these functions
as well.

No in-tree consumer currently checks for errno on error reported by
these functions, so this change has no other code impact.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40342

(cherry picked from commit b8c1aadef9d80786daf731300c33d3a001261422)

Details

Provenance
olceAuthored on May 25 2023, 11:48 AM
emasteCommitted on Oct 13 2023, 2:13 PM
Reviewer
kib
Differential Revision
D40342: login_cap.c: Don't set errno to ERANGE on memory allocation failure
Parents
rG74e9205b5e4f: openssl: document the update process
Branches
Unknown
Tags
Unknown