From: Stefan Berger Date: Tue, 30 Jan 2018 13:54:30 +0000 (-0500) Subject: swtpm: close client file descriptor if POLLERR is indicated X-Git-Tag: v0.7.0-rc1~844 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4a10cb1380f3d8ccb09e002d9134e87ee374bfd9;p=swtpm.git swtpm: close client file descriptor if POLLERR is indicated POLLERR is indicated in some error cases when using the chardev with the vtpm_proxy with runc. In case the flag is set, we terminate the client connection rather than endlessly looping. Signed-off-by: Stefan Berger --- diff --git a/src/swtpm/mainloop.c b/src/swtpm/mainloop.c index 648678b..cc3c034 100644 --- a/src/swtpm/mainloop.c +++ b/src/swtpm/mainloop.c @@ -162,7 +162,7 @@ int mainLoop(struct mainLoopParams *mlp, break; } - if (pollfds[DATA_CLIENT_FD].revents & POLLHUP) { + if (pollfds[DATA_CLIENT_FD].revents & (POLLHUP | POLLERR)) { logprintf(STDERR_FILENO, "Data client disconnected\n"); mlp->fd = -1; /* chardev and unixio get this signal, not tcp */