git: a1e37beb45d2 - main - cr_bsd_visible(): Style fixes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 10 Jan 2024 17:50:38 UTC
The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a1e37beb45d270ae9926eff3b93e9398d08c94e5 commit a1e37beb45d270ae9926eff3b93e9398d08c94e5 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2024-01-05 15:23:19 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2024-01-10 17:50:19 +0000 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 --- sys/kern/kern_prot.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 0ebedcd72fc3..be8e0b14add2 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -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); }