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

Details

Provenance
olceAuthored on May 25 2023, 11:48 AM
emasteCommitted on Oct 2 2023, 8:41 PM
Reviewer
kib
Differential Revision
D40342: login_cap.c: Don't set errno to ERANGE on memory allocation failure
Parents
rGbd572be78436: setusercontext(): Fix gap when setting a realtime-class priority
Branches
Unknown
Tags
Unknown