From b7eae257f1aa6a6356eaf96a9dcdc5fcf266b8fe Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 12 Jun 2009 15:14:42 -0700 Subject: [PATCH] vconn: Report valid errno value if connection closed waiting for hello. vconn_connect() is defined to return 0 on success or a positive errno value on failure, but it was possible to get a negative value (EOF). This commit changes this to ECONNRESET to match caller expectations. --- lib/vconn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vconn.c b/lib/vconn.c index e4afb22e..3c4efdba 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -339,7 +339,7 @@ vcs_recv_hello(struct vconn *vconn) if (retval != EAGAIN) { vconn->state = VCS_DISCONNECTED; - vconn->error = retval; + vconn->error = retval == EOF ? ECONNRESET : retval; } } -- 2.30.2