From 362c78d88450be692a9eab9a4dc9d3fb91376380 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 17 Dec 2024 19:40:03 -0800 Subject: [PATCH] stdsock: On windows, don't check error return from shutdown There are cases where it will error if it's not connected, but it doesn't matter. So just ignore the return value. Signed-off-by: Corey Minyard --- lib/gensio_stdsock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/gensio_stdsock.c b/lib/gensio_stdsock.c index f5074bc3..b97a614b 100644 --- a/lib/gensio_stdsock.c +++ b/lib/gensio_stdsock.c @@ -183,9 +183,8 @@ close_socket(struct gensio_os_funcs *o, int fd) * to the same system. The socket will only close when all connections * to that system close. Windows is broken in so many ways. */ - err = shutdown(fd, SD_BOTH); - if (!err) - err = closesocket(fd); + shutdown(fd, SD_BOTH); + err = closesocket(fd); #else err = close(fd); #endif