[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-devel
Subject:    [lxc-devel] [lxc/master] tools: use boolean for ret in lxc_device.c
From:       brauner on Github <lxc-bot () linuxcontainers ! org>
Date:       2016-08-26 10:50:25
Message-ID: 20160826105025.967B338FA4 () mailman01 ! srv ! dcmtl ! stgraber ! net
[Download RAW message or body]

[Attachment #2 (text/x-mailbox)]

The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1151

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <cbrauner@suse.de>

As spotted by @hallyn.

[Attachment #3 (text/plain)]

From 30a5e4367b05e393f32594014fb0d82b76f0a60a Mon Sep 17 00:00:00 2001
From: Christian Brauner <cbrauner@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@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);

[Attachment #4 (text/plain)]

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic