summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-12-09 22:06:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-03-14 14:16:33 +0100
commitfa0938a6e3cb928602633c3da0b909deb269369d (patch)
tree6ebe9d9b79752f29a6587eaf5bb296d1e76b3837 /src/monitor
parent2bdadc5274df42738b97045cd01cd63d3651daf9 (diff)
downloadsssd-fa0938a6e3cb928602633c3da0b909deb269369d.tar.gz
sssd-fa0938a6e3cb928602633c3da0b909deb269369d.tar.xz
sssd-fa0938a6e3cb928602633c3da0b909deb269369d.zip
Use pattern #elif defined(identifier)
We had in source code following pattern #elif HAVE_<name> It worked because undefined identifier(in some cases) was evaluated to 0. But we do not care about value of HAVE_SOMETHING. We just need to know whether identifier was defined. There is not equivalent to #ifdef (short for of #if definded) We need to use long form: #elif defined HAVE_<name> It causes also compiler warning with enabled compiler flag -Wundef. Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor_netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c
index b4d636191..51e8ffe47 100644
--- a/src/monitor/monitor_netlink.c
+++ b/src/monitor/monitor_netlink.c
@@ -80,7 +80,7 @@
#define nlw_handle nl_sock
-#elif HAVE_LIBNL1
+#elif defined(HAVE_LIBNL1)
#define nlw_destroy_handle nl_handle_destroy
#define nlw_alloc nl_handle_alloc
@@ -413,7 +413,7 @@ static int nlw_enable_passcred(struct nlw_handle *nlp)
{
#ifdef HAVE_NL_SET_PASSCRED
return nl_set_passcred(nlp, 1); /* 1 = enabled */
-#elif HAVE_NL_SOCKET_SET_PASSCRED
+#elif defined(HAVE_NL_SOCKET_SET_PASSCRED)
return nl_socket_set_passcred(nlp, 1);
#else
return EOK; /* not available in this version */