mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-02-05 22:54:09 +00:00
swtpm: Loop over poll() in case of EINTR
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
a442092d8e
commit
ad2fb40077
@ -416,9 +416,14 @@ wait_chunk:
|
||||
to = timeout.tv_sec * 1000 + timeout.tv_nsec / 1E6;
|
||||
|
||||
/* wait for the next chunk */
|
||||
n = poll(&pollfd, 1, to);
|
||||
if (n <= 0)
|
||||
return n;
|
||||
while (true) {
|
||||
n = poll(&pollfd, 1, to);
|
||||
if (n < 0 && errno == EINTR)
|
||||
continue;
|
||||
if (n <= 0)
|
||||
return n;
|
||||
break;
|
||||
}
|
||||
/* we should have data now */
|
||||
}
|
||||
return recvd;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user