mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
52970dec5b
commit
ea0486873e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user