summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sockutil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sockutil.c b/sockutil.c
index a86290d..641b9ce 100644
--- a/sockutil.c
+++ b/sockutil.c
@@ -113,6 +113,7 @@ recv_packet(int fd)
do {
if ((ret = read(fd, (char *)psbuf+bufused, sizeof packetsize - bufused)) < 0) {
+ if (errno == EINTR) continue;
lprintf(LOG_ERR, "Read error while reading packet size: %s\n", strerror(errno));
return NULL;
} else if (ret == 0) {
@@ -130,6 +131,7 @@ recv_packet(int fd)
bufused = 0;
do {
if ((ret = read(fd, buf+bufused, packetsize-bufused)) < 0) {
+ if (errno == EINTR) continue;
lprintf(LOG_ERR, "Read error while reading packet data: %s\n", strerror(errno));
return NULL;
}
@@ -159,6 +161,7 @@ send_packet(int fd, struct qa_packet *qp)
do {
if ((ret = write(fd, (char *)psbuf+bufused, sizeof packetsize - bufused)) < 0) {
+ if (errno == EINTR) continue;
lprintf(LOG_ERR, "Write error while sending packet size: %s\n", strerror(errno));
return -1;
}
@@ -168,6 +171,7 @@ send_packet(int fd, struct qa_packet *qp)
bufused = 0;
do {
if ((ret = write(fd, buf+bufused, len - bufused)) < 0) {
+ if (errno == EINTR) continue;
lprintf(LOG_ERR, "Write error while sending packet data: %s\n", strerror(errno));
return -1;
}