Since the if uses >=, the - 1 is not needed and the MAXFDS'th
entry in the fds array can be used.
---
src/lxc/cgroup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index a02ebc2..7bb88b5 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -398,7 +398,7 @@ int lxc_cgroup_prepare_attach(const char *name, void **data)
err = 0;
i = 0;
while ((mntent = getmntent(file))) {
- if (i >= MAXFDS - 1) {
+ if (i >= MAXFDS) {
ERROR("too many cgroups to attach to, aborting");
lxc_cgroup_dispose_attach(fds);
errno = ENOMEM;
--
1.7.1
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-devel