summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-10-25 00:43:18 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-10-25 00:43:18 +0200
commit23b58da79166cb3f37a822adfa63107896c7e129 (patch)
treeac5df4a400067d920380a181c933e3e6ed1ade69 /src
parentdc7aaccd9fb034f0cc7ac3440b0d1b991bd034dc (diff)
downloadlibmnl-23b58da79166cb3f37a822adfa63107896c7e129.tar.gz
libmnl-23b58da79166cb3f37a822adfa63107896c7e129.zip
nlmsg: use bool return type for yes-no functions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/nlmsg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nlmsg.c b/src/nlmsg.c
index 535f4b5..f89a9ec 100644
--- a/src/nlmsg.c
+++ b/src/nlmsg.c
@@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
-
+#include <stdbool.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
@@ -200,8 +200,8 @@ void *mnl_nlmsg_get_payload_tail(const struct nlmsghdr *nlh)
* \param nlh current netlink message that we are handling
* \param seq last sequence number used to send a message
*
- * This functions returns 1 if the sequence tracking is fulfilled, otherwise
- * 0 is returned. We skip the tracking for netlink messages whose sequence
+ * This functions returns true if the sequence tracking is fulfilled, otherwise
+ * false is returned. We skip the tracking for netlink messages whose sequence
* number is zero since it is usually reserved for event-based kernel
* notifications. On the other hand, if seq is set but the message sequence
* number is not set (i.e. this is an event message coming from kernel-space),
@@ -209,9 +209,9 @@ void *mnl_nlmsg_get_payload_tail(const struct nlmsghdr *nlh)
* socket to send commands to kernel-space (that we want to track) and to
* listen to events (that we do not track).
*/
-int mnl_nlmsg_seq_ok(const struct nlmsghdr *nlh, unsigned int seq)
+bool mnl_nlmsg_seq_ok(const struct nlmsghdr *nlh, unsigned int seq)
{
- return nlh->nlmsg_seq && seq ? nlh->nlmsg_seq == seq : 1;
+ return nlh->nlmsg_seq && seq ? nlh->nlmsg_seq == seq : true;
}
/**
@@ -219,8 +219,8 @@ int mnl_nlmsg_seq_ok(const struct nlmsghdr *nlh, unsigned int seq)
* \param nlh current netlink message that we are handling
* \param seq netlink portid that we want to check
*
- * This functions returns 1 if the origin is fulfilled, otherwise
- * 0 is returned. We skip the tracking for netlink message whose portID
+ * This functions returns true if the origin is fulfilled, otherwise
+ * false is returned. We skip the tracking for netlink message whose portID
* is zero since it is reserved for event-based kernel notifications. On the
* other hand, if portid is set but the message PortID is not (i.e. this
* is an event message coming from kernel-space), then we also skip the
@@ -228,9 +228,9 @@ int mnl_nlmsg_seq_ok(const struct nlmsghdr *nlh, unsigned int seq)
* to kernel-space (that we want to track) and to listen to events (that we
* do not track).
*/
-int mnl_nlmsg_portid_ok(const struct nlmsghdr *nlh, unsigned int portid)
+bool mnl_nlmsg_portid_ok(const struct nlmsghdr *nlh, unsigned int portid)
{
- return nlh->nlmsg_pid && portid ? nlh->nlmsg_pid == portid : 1;
+ return nlh->nlmsg_pid && portid ? nlh->nlmsg_pid == portid : true;
}
/**