Skip to content

Commit

Permalink
stdsock: On windows, don't check error return from shutdown
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cminyard committed Dec 18, 2024
1 parent faf855e commit 362c78d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/gensio_stdsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 362c78d

Please sign in to comment.