提交 66d70a8f 编写于 作者: E Eric Blake 提交者: Jim Meyering

libvirtd: avoid false-positive NULL-deref warning from clang

* daemon/libvirtd.c (qemudWorker): Rewrite loop to silence a
warning.
上级 e749d776
......@@ -1502,16 +1502,15 @@ static void *qemudWorker(void *data)
struct qemud_client_message *msg;
virMutexLock(&server->lock);
while (((client = qemudPendingJob(server)) == NULL) &&
!worker->quitRequest) {
if (virCondWait(&server->job, &server->lock) < 0) {
while ((client = qemudPendingJob(server)) == NULL) {
if (worker->quitRequest ||
virCondWait(&server->job, &server->lock) < 0) {
virMutexUnlock(&server->lock);
return NULL;
}
}
if (worker->quitRequest) {
if (client)
virMutexUnlock(&client->lock);
virMutexUnlock(&client->lock);
virMutexUnlock(&server->lock);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册