Re: [PATCH] libsepol: use bool instead of int in validation functions

Kalevi Kolttonen <[email protected]>
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
On Mon, Aug 17, 2026 at 09:58:27AM -0400, Stephen Smalley wrote:
> One last reason to not apply this patch: it makes the code less
> consistent, not more, since as you said, you don't convert all the
> functions to reduce the scope of the change. I'd rather keep it
> consistent.

I never claimed this patch would achieve more consistency. The
basic idea was just to make it explicit that these validation
functions are essentially boolean in nature: either the validation
succeeds ("true") or not ("false"). So using int seems wrong.

But I do get the point that it is cleaner to have all the
functions have the same return type. I consider it one of the
design errors of C language that it did not have boolean type
right from the beginning. It is what it is, though.

br,
KK
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.