PERROR("Relay command zmalloc");
goto error;
}
- ret = read(fd, relay_connection, sizeof(struct relay_command));
+ do {
+ ret = read(fd, relay_connection, sizeof(struct relay_command));
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 || ret < sizeof(struct relay_command)) {
PERROR("read relay cmd pipe");
goto error_read;
/* Check for data on kernel pipe */
if (pollfd == kernel_poll_pipe[0] && (revents & LPOLLIN)) {
- ret = read(kernel_poll_pipe[0], &tmp, 1);
+ do {
+ ret = read(kernel_poll_pipe[0], &tmp, 1);
+ } while (ret < 0 && errno == EINTR);
+ /*
+ * Ret value is useless here, if this pipe gets any actions an
+ * update is required anyway.
+ */
update_poll_flag = 1;
continue;
} else {
goto error;
} else if (revents & LPOLLIN) {
/* Empty pipe */
- ret = read(apps_cmd_pipe[0], &ust_cmd, sizeof(ust_cmd));
+ do {
+ ret = read(apps_cmd_pipe[0], &ust_cmd, sizeof(ust_cmd));
+ } while (ret < 0 && errno == EINTR);
if (ret < 0 || ret < sizeof(ust_cmd)) {
PERROR("read apps cmd pipe");
goto error;