mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-14 09:23:45 -06:00
client rpc: Fix error checking after poll()
First 'poll' can't return EWOULDBLOCK, and second, we're checking errno so far away from the poll() call that we've probably already trashed the original errno value.
This commit is contained in:
parent
4d971dc7ef
commit
5d490603a6
@ -1347,6 +1347,12 @@ static int virNetClientIOEventLoop(virNetClientPtr client,
|
||||
|
||||
virNetClientLock(client);
|
||||
|
||||
if (ret < 0) {
|
||||
virReportSystemError(errno,
|
||||
"%s", _("poll on socket failed"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virKeepAliveTrigger(client->keepalive, &msg)) {
|
||||
client->wantClose = true;
|
||||
} else if (msg && virNetClientQueueNonBlocking(client, msg) < 0) {
|
||||
@ -1375,15 +1381,6 @@ static int virNetClientIOEventLoop(virNetClientPtr client,
|
||||
}
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
/* XXX what's this dubious errno check doing ? */
|
||||
if (errno == EWOULDBLOCK)
|
||||
continue;
|
||||
virReportSystemError(errno,
|
||||
"%s", _("poll on socket failed"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (fds[0].revents & POLLOUT) {
|
||||
if (virNetClientIOHandleOutput(client) < 0)
|
||||
goto error;
|
||||
|
Loading…
Reference in New Issue
Block a user