提交 bc4b4330 编写于 作者: L Laine Stump

util: fix index when building lock owners array

The "restart" function for locks allocates a new array according to
and pre-sets its length, then reads the owner pids from a JSON
document in a loop. Rather than adding each owner at a different
index, though, it repeatedly overwrites the last element of the array
with all the owners.
上级 3782814d
......@@ -435,7 +435,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
goto error;
}
res->owners[res->nOwners-1] = (pid_t)owner;
res->owners[j] = (pid_t)owner;
}
if (virHashAddEntry(lockspace->resources, res->name, res) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册