libselinux: avc_internal.c: allow building with clang

Resolves the following errors from clang:
avc_internal.c:105:25: error: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
                               ^~~~~~~~~~~~~~~~~~~~~~
avc_internal.c:161:25: error: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
                               ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
Stephen Smalley 2016-11-01 16:59:47 -04:00
parent 6e6134cb7e
commit 4c519cd730
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ void avc_netlink_close(void)
fd = -1;
}
static int avc_netlink_receive(char *buf, unsigned buflen, int blocking)
static int avc_netlink_receive(void *buf, unsigned buflen, int blocking)
{
int rc;
struct pollfd pfd = { fd, POLLIN | POLLPRI, 0 };
@ -155,7 +155,7 @@ static int avc_netlink_receive(char *buf, unsigned buflen, int blocking)
return 0;
}
static int avc_netlink_process(char *buf)
static int avc_netlink_process(void *buf)
{
int rc;
struct nlmsghdr *nlh = (struct nlmsghdr *)buf;