summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2009-02-17 08:48:40 -0500
committerAlan D. Brunelle <alan.brunelle@hp.com>2009-02-17 08:48:40 -0500
commit5d65b5e6333cfdd14ab0e944cef8474445e531b3 (patch)
tree6d5b6308b2ee09bfa89d967af120ff72c5e43c9f
parent358504bb7869e73e38abcbc78b50d441f693711e (diff)
downloadblktrace-5d65b5e6333cfdd14ab0e944cef8474445e531b3.tar.gz
blktrace-5d65b5e6333cfdd14ab0e944cef8474445e531b3.tar.bz2
Fixed EAGAIN handling in blktrace.c
EAGAIN was causing header failures in network mode. Added in a usleep and retried the recv(). Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
-rw-r--r--blktrace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/blktrace.c b/blktrace.c
index 6469586..26b3afd 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -799,8 +799,11 @@ static int __net_recv_data(int fd, void *buf, unsigned int len)
if (ret == 0)
break;
else if (ret < 0) {
- if (errno != EAGAIN)
- perror("server: net_recv_data: recv failed");
+ if (errno == EAGAIN) {
+ usleep(50);
+ continue;
+ }
+ perror("server: net_recv_data: recv failed");
break;
} else {
buf += ret;