[sheepdog] [PATCH] net: connection shouldn't be closed on EINTR error

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Jan 31 05:49:13 CET 2013


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/net.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/net.c b/lib/net.c
index 596f9a9..1a823a1 100644
--- a/lib/net.c
+++ b/lib/net.c
@@ -79,7 +79,7 @@ int rx(struct connection *conn, enum conn_state next_state)
 	}
 
 	if (ret < 0) {
-		if (errno != EAGAIN)
+		if (errno != EAGAIN && errno != EINTR)
 			conn->c_rx_state = C_IO_CLOSED;
 		return 0;
 	}
@@ -99,7 +99,7 @@ notrace int tx(struct connection *conn, enum conn_state next_state)
 
 	ret = write(conn->fd, conn->tx_buf, conn->tx_length);
 	if (ret < 0) {
-		if (errno != EAGAIN)
+		if (errno != EAGAIN && errno != EINTR)
 			conn->c_tx_state = C_IO_CLOSED;
 		return 0;
 	}
-- 
1.7.2.5




More information about the sheepdog mailing list