selinux-testsuite: fix cap_userns compiler warnings
PATCH 1/1 selinux-testsuite: fix cap_userns compiler warnings
The top-level Makefile defines _GNU_SOURCE by default which causes the following build warning:
cc -g -O0 -Wall -D_GNU_SOURCE userns_child_exec.c -o userns_child_exec userns_child_exec.c:11:0: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
... this patch first checks to see if _GNU_SOURCE is defined before defining it again. We're doing it this way, instead of removing it entirely so that the test will still work outside the testsuite.
Signed-off-by Paul Moore <[email protected]>
--- tests/cap_userns/userns_child_exec.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/cap_userns/userns_child_exec.c +4 -0
@@ -8,7 +8,11 @@namespace(s); allow UID and GID mappings to be specified when creating a user namespace. */ + +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif +#include <sched.h> #include <unistd.h> #include <stdlib.h>