diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 77a038a9177648de8e5287f4e755b208402f8915..e6b78efbc3a06e0371ef9c3eada45fc747af3a6a 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -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