提交 ea048687 编写于 作者: M Michal Privoznik

util: Allow virProcessSetNamespaces() to have sparse FD list

So far, the virProcessSetNamespaces() takes an array of FDs that
it tries to set namespace on. However, in the very next commit
this array may be sparse, having some -1's in it. Teach the
function to cope with that.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 52970dec
......@@ -705,6 +705,9 @@ int virProcessSetNamespaces(size_t nfdlist,
return -1;
}
for (i = 0; i < nfdlist; i++) {
if (fdlist[i] < 0)
continue;
/* We get EINVAL if new NS is same as the current
* NS, or if the fd namespace doesn't match the
* type passed to setns()'s second param. Since we
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册