From 070505f16f59b1ddbc6af670a04a3610253f50fc Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Tue, 16 Feb 2010 09:29:31 -0500 Subject: [PATCH] label_file.c:434: error: implicit declaration of function 'fstat' On Mon, 2010-02-15 at 14:19 -0800, Justin Mattock wrote: > this is new: > > > make[2]: Leaving directory `/home/kernel/selinux/libselinux/include' > make -C src install > make[2]: Entering directory `/home/kernel/selinux/libselinux/src' > cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn > -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE > -D_FILE_OFFSET_BITS=64 -c -o label_file.o label_file.c > cc1: warnings being treated as errors > label_file.c: In function 'init': > label_file.c:434: error: implicit declaration of function 'fstat' > label_file.c:436: error: implicit declaration of function 'S_ISREG' > make[2]: *** [label_file.o] Error 1 > make[2]: Leaving directory `/home/kernel/selinux/libselinux/src' > make[1]: *** [install] Error 2 > make[1]: Leaving directory `/home/kernel/selinux/libselinux' > make: *** [install] Error 1 > > three areas where this could of been created > update glibc > updated kernel > update userspace(altohugh there was not vary many commits in the pull). Newer glibc headers expose a failure to #include the required headers for stat(2). Also exposes a conflict in redefining close() in that file. Patch below should fix. --- libselinux/src/label_file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index b5e904f9..509b033a 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -17,6 +17,9 @@ #include #include #include +#include +#include +#include #include "callbacks.h" #include "label_internal.h" @@ -545,7 +548,7 @@ finish: /* * Backend interface routines */ -static void close(struct selabel_handle *rec) +static void closef(struct selabel_handle *rec) { struct saved_data *data = (struct saved_data *)rec->data; struct spec *spec; @@ -666,7 +669,7 @@ int selabel_file_init(struct selabel_handle *rec, struct selinux_opt *opts, memset(data, 0, sizeof(*data)); rec->data = data; - rec->func_close = &close; + rec->func_close = &closef; rec->func_stats = &stats; rec->func_lookup = &lookup;