cr_bsd_visible(): Style fixes

Explicitly test for non-zero return codes.

Separate assignment and testing of 'error' in distinct lines.

Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              1 week
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43335
This commit is contained in:
Olivier Certner 2024-01-05 16:23:19 +01:00
parent 6211cd4be3
commit a1e37beb45
No known key found for this signature in database
GPG key ID: 8CA13040971E2627

View file

@ -1463,11 +1463,14 @@ cr_bsd_visible(struct ucred *u1, struct ucred *u2)
{
int error;
if ((error = cr_canseeotheruids(u1, u2)))
error = cr_canseeotheruids(u1, u2);
if (error != 0)
return (error);
if ((error = cr_canseeothergids(u1, u2)))
error = cr_canseeothergids(u1, u2);
if (error != 0)
return (error);
if ((error = cr_canseejailproc(u1, u2)))
error = cr_canseejailproc(u1, u2);
if (error != 0)
return (error);
return (0);
}