From: Guus Sliepen Date: Fri, 30 Oct 2015 22:16:47 +0000 (+0100) Subject: Ensure utcp_close() works properly on a socket that is in the CLOSED state. X-Git-Url: http://git.meshlink.io/?p=utcp;a=commitdiff_plain;h=4e0031cf31b22f6cff80969c3e6e11c3c3001b04 Ensure utcp_close() works properly on a socket that is in the CLOSED state. --- diff --git a/utcp.c b/utcp.c index f2354b1..026fb31 100644 --- a/utcp.c +++ b/utcp.c @@ -1294,7 +1294,7 @@ int utcp_shutdown(struct utcp_connection *c, int dir) { } int utcp_close(struct utcp_connection *c) { - if(utcp_shutdown(c, SHUT_RDWR)) + if(utcp_shutdown(c, SHUT_RDWR) && errno != ENOTCONN) return -1; c->recv = NULL; c->poll = NULL;