aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap2
diff options
context:
space:
mode:
Diffstat (limited to 'tools/blktap2')
-rw-r--r--tools/blktap2/control/tap-ctl-ipc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap2/control/tap-ctl-ipc.c
index c8aad1ccda..c7e42d9cb9 100644
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap2/control/tap-ctl-ipc.c
@@ -71,8 +71,11 @@ tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
}
else if (FD_ISSET(fd, &readfds)) {
ret = read(fd, message + offset, len - offset);
- if (ret <= 0)
+ if (ret <= 0) {
+ if (errno == EINTR)
+ continue;
break;
+ }
offset += ret;
} else
break;
@@ -124,8 +127,11 @@ tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
}
else if (FD_ISSET(fd, &writefds)) {
ret = write(fd, message + offset, len - offset);
- if (ret <= 0)
+ if (ret <= 0) {
+ if (errno == EINTR)
+ continue;
break;
+ }
offset += ret;
} else
break;