policycoreutils: newrole: add missing defined in #if
PATCH 1/1 policycoreutils: newrole: add missing defined in #if
When building newrole with gcc 5.3.0 and some warning flags, the compiler reports:
newrole.c:77:33: error: "NAMESPACE_PRIV" is not defined [-Werror=undef]
#if defined(AUDIT_LOG_PRIV) || (NAMESPACE_PRIV)
^Indeed, "defined" is missing here. This nevertheless worked so far because when NAMESPACE_PRIV was selected in the Makefile, newrole.c was compiled with "-DNAMESPACE_PRIV", which defined NAMESPACE_PRIV to 1.
Signed-off-by Nicolas Iooss <[email protected]>
--- policycoreutils/newrole/newrole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/newrole/newrole.c +1 -1
@@ -74,7 +74,7 @@#ifdef USE_AUDIT #include <libaudit.h> #endif -#if defined(AUDIT_LOG_PRIV ) || (NAMESPACE_PRIV ) +#if defined(AUDIT_LOG_PRIV ) || defined(NAMESPACE_PRIV )#include <sys/prctl.h> #include <cap-ng.h> #endif
Signature · 1 line
2.7.0
Quoted 7 lines · Nicolas Iooss
When building newrole with gcc 5.3.0 and some warning flags, the compiler reports:
newrole.c:77:33: error: "NAMESPACE_PRIV" is not defined [-Werror=undef] #if defined(AUDIT_LOG_PRIV) || (NAMESPACE_PRIV) ^
Quoted 5 lines
Indeed, "defined" is missing here. This nevertheless worked so far because when
NAMESPACE_PRIVwas selected in theMakefile,newrole.cwas compiled with "-DNAMESPACE_PRIV", which definedNAMESPACE_PRIVto 1.Signed-off-by Nicolas Iooss <[email protected]>
Patch applied. Thanks!
- Steve
Quoted 18 lines
--- policycoreutils/newrole/newrole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)policycoreutils/newrole/newrole.c +1
-1@@ -74,7 +74,7 @@#ifdef USE_AUDIT #include <libaudit.h> #endif -#if defined(AUDIT_LOG_PRIV ) || (NAMESPACE_PRIV ) +#if defined(AUDIT_LOG_PRIV ) || defined(NAMESPACE_PRIV )#include <sys/prctl.h> #include <cap-ng.h> #endif