From 412ef440b3f04db6121f3b573b28d792954e04fc Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 24 Apr 2013 23:08:22 +1000 Subject: [PATCH] Use sock_blocks in api.c --- api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.c b/api.c index f8488f7c..427ef074 100644 --- a/api.c +++ b/api.c @@ -3481,7 +3481,7 @@ static void send_result(struct io_data *io_data, SOCKETTYPE c, bool isjson) n = send(c, buf, tosend, 0); if (SOCKETFAIL(n)) { - if (errno == EAGAIN || errno == EWOULDBLOCK) + if (sock_blocks()) continue; applog(LOG_WARNING, "API: send (%d) failed: %s", tosend, SOCKERRMSG);