libselinux: set an appropriate errno in booleans.c

Fixes:
$ mkdir booleans
$ sudo mount --bind ./booleans /sys/fs/selinux/booleans
$ sudo getsebool -a
getsebool:  Unable to get boolean names:  Success

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
Petr Lautrbach 2019-01-31 20:48:23 +01:00 committed by Nicolas Iooss
parent 474a09233c
commit 5689d82a44
No known key found for this signature in database
GPG Key ID: C191415F340DAAA0

View File

@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len)
snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
*len = scandir(path, &namelist, &filename_select, alphasort);
if (*len <= 0) {
errno = ENOENT;
return -1;
}