diff options
-rw-r--r-- | src/input/ipa.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/input/ipa.c b/src/input/ipa.c index 26bf170..554644c 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -336,15 +336,13 @@ static void ipa_server_conn_read(struct ipa_server_conn *conn) LOGIPA(conn, LOGL_DEBUG, "message received\n"); ret = ipa_msg_recv_buffered(ofd->fd, &msg, &conn->pending_msg); - if (ret < 0) { + if (ret <= 0) { if (ret == -EAGAIN) return; - if (ret == -EPIPE || ret == -ECONNRESET) + else if (ret == -EPIPE || ret == -ECONNRESET) LOGIPA(conn, LOGL_ERROR, "lost connection with server\n"); - ipa_server_conn_destroy(conn); - return; - } else if (ret == 0) { - LOGIPA(conn, LOGL_ERROR, "connection closed with server\n"); + else if (ret == 0) + LOGIPA(conn, LOGL_ERROR, "connection closed with server\n"); ipa_server_conn_destroy(conn); return; } |