From: Ben Pfaff Date: Fri, 12 Jun 2009 22:14:42 +0000 (-0700) Subject: vconn: Report valid errno value if connection closed waiting for hello. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7eae257f1aa6a6356eaf96a9dcdc5fcf266b8fe;p=openvswitch 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. --- 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; } }