/* 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;
* at some point in time or wait to the end of the world :)
*/
if (apps_cmd_pipe[1] >= 0) {
- ret = write(apps_cmd_pipe[1], ust_cmd,
- sizeof(struct ust_command));
+ do {
+ ret = write(apps_cmd_pipe[1], ust_cmd,
+ sizeof(struct ust_command));
+ } while (ret < 0 && errno == EINTR);
if (ret < 0) {
PERROR("write apps cmd pipe");
if (errno == EBADF) {