[lxc-devel] [lxc/master] tools: use boolean for ret in lxc_device.c
brauner on Github
lxc-bot at linuxcontainers.org
Fri Aug 26 10:50:24 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 378 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160826/3fb9aebe/attachment.bin>
-------------- next part --------------
From 30a5e4367b05e393f32594014fb0d82b76f0a60a Mon Sep 17 00:00:00 2001
From: Christian Brauner <cbrauner at suse.de>
Date: Fri, 26 Aug 2016 12:49:23 +0200
Subject: [PATCH] tools: use boolean for ret in lxc_device.c
Signed-off-by: Christian Brauner <cbrauner at suse.de>
---
src/lxc/tools/lxc_device.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/lxc/tools/lxc_device.c b/src/lxc/tools/lxc_device.c
index abf52b9..39c560c 100644
--- a/src/lxc/tools/lxc_device.c
+++ b/src/lxc/tools/lxc_device.c
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
{
struct lxc_container *c;
char *cmd, *dev_name, *dst_name;
- int ret = 1;
+ bool ret = false;
if (geteuid() != 0) {
ERROR("%s must be run as root", argv[0]);
@@ -164,7 +164,6 @@ int main(int argc, char *argv[])
}
if (ret != true) {
ERROR("Failed to add %s to %s.", dev_name, c->name);
- ret = 1;
goto err1;
}
INFO("Add %s to %s.", dev_name, c->name);
@@ -176,7 +175,6 @@ int main(int argc, char *argv[])
}
if (ret != true) {
ERROR("Failed to del %s from %s.", dev_name, c->name);
- ret = 1;
goto err1;
}
INFO("Delete %s from %s.", dev_name, c->name);
More information about the lxc-devel
mailing list