In case the poll() is interrupted by a signal handler and we
get EINTR, we loop again assuming that the signal handler will
send us a notification to end.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
int ctrlclntfd;
bool readall;
int sockfd;
+ int ready;
/* poolfd[] indexes */
enum {
if (connection_fd.fd < 0)
pollfds[DATA_SERVER_FD].fd = sockfd;
- if (poll(pollfds, 5, -1) < 0 ||
+ ready = poll(pollfds, 5, -1);
+ if (ready < 0 && errno == EINTR)
+ continue;
+
+ if (ready < 0 ||
(pollfds[NOTIFY_FD].revents & POLLIN) != 0) {
SWTPM_IO_Disconnect(&connection_fd);
break;