summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-04-12 17:04:40 +0200
committerGravatar waker <wakeroid@gmail.com>2012-04-12 17:04:40 +0200
commit8c09c8ee62e8a76b98932f2db12473199c5fe18c (patch)
tree301572cc9d6fc31c5d9fd3d7080e62c8e69154f9 /main.c
parent22e3a091e2a595fdd2b3f2bf06f8ad9ace4cc27b (diff)
fix broken pipe error on fbsd while waiting for data from nonblocking socket
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index b4005e17..c5c06875 100644
--- a/main.c
+++ b/main.c
@@ -405,6 +405,10 @@ read_entire_message (int sockfd, int *size) {
int rd = recv(sockfd, buf + rdp, bufsize - rdp, 0);
if (rd < 0) {
+ if (errno == EAGAIN) {
+ usleep (50000);
+ continue;
+ }
free(buf);
return NULL;
}