From 4e0031cf31b22f6cff80969c3e6e11c3c3001b04 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 30 Oct 2015 23:16:47 +0100 Subject: [PATCH] Ensure utcp_close() works properly on a socket that is in the CLOSED state. --- utcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5