From ea850215ab4b13de504dcd765c95eb67b6be8ff7 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Fri, 5 Feb 2016 14:16:49 +0200 Subject: [PATCH] Gracefully close the socket --- tftp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tftp.c b/tftp.c index 5a09aa2..80efff0 100644 --- a/tftp.c +++ b/tftp.c @@ -314,7 +314,12 @@ cleanup: } if (sock >= 0) { + shutdown(sock, SHUT_RDWR); +#ifndef NMRPFLASH_WINDOWS close(sock); +#else + closesocket(sock); +#endif } return err; -- 2.25.1