libselinux: include errno.h instead of sys/errno.h

Building with musl libc leads to some build errors:

    setrans_client.c: In function ‘receive_response’:
    setrans_client.c:147:19: error: implicit declaration of function
    ‘readv’ [-Werror=implicit-function-declaration]
      while (((count = readv(fd, resp_hdr, 3)) < 0) && (errno == EINTR)) ;
                       ^~~~~

and:

    In file included from matchpathcon.c:10:0:
    /usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect
    #include <sys/errno.h> to <errno.h> [-Werror=cpp]
     #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
      ^

Fix the first one by including <sys/uio.h> and the second one by using
<errno.h> instead of <sys/errno.h>.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-01-08 19:45:51 +01:00 committed by Stephen Smalley
parent d4923b49b4
commit 3c85f9f1a0
3 changed files with 2 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/uio.h>
#include "dso.h"
#include "selinux_internal.h"
#include "setrans_internal.h"

View File

@ -7,7 +7,6 @@
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <selinux/selinux.h>
#include <limits.h>
#include <stdlib.h>

View File

@ -1,3 +1,4 @@
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@ -6,7 +7,6 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <selinux/selinux.h>
static __attribute__ ((__noreturn__)) void usage(const char *progname)