[lxc-devel] [lxcfs/master] cleanup: return false instead of NULL as bool

Blub on Github lxc-bot at linuxcontainers.org
Thu Feb 2 08:51:28 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 359 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170202/baba69f3/attachment.bin>
-------------- next part --------------
From 234a820c456fdd3ab78ff2fe95f5fbe74001dad8 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumiller at proxmox.com>
Date: Wed, 1 Feb 2017 15:19:24 +0100
Subject: [PATCH] cleanup: return false instead of NULL as bool

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 bindings.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bindings.c b/bindings.c
index a23c349..2d4c36a 100644
--- a/bindings.c
+++ b/bindings.c
@@ -863,11 +863,11 @@ bool cgfs_get_value(const char *controller, const char *cgroup, const char *file
 	fnam = alloca(len);
 	ret = snprintf(fnam, len, "%s%s/%s", *cgroup == '/' ? "." : "", cgroup, file);
 	if (ret < 0 || (size_t)ret >= len)
-		return NULL;
+		return false;
 
 	fd = openat(cfd, fnam, O_RDONLY);
 	if (fd < 0)
-		return NULL;
+		return false;
 
 	*value = slurp_file(fnam, fd);
 	return *value != NULL;


More information about the lxc-devel mailing list