Gracefully close the socket
This commit is contained in:
parent
74ab06f9e8
commit
ea850215ab
1 changed files with 5 additions and 0 deletions
5
tftp.c
5
tftp.c
|
@ -314,7 +314,12 @@ cleanup:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sock >= 0) {
|
if (sock >= 0) {
|
||||||
|
shutdown(sock, SHUT_RDWR);
|
||||||
|
#ifndef NMRPFLASH_WINDOWS
|
||||||
close(sock);
|
close(sock);
|
||||||
|
#else
|
||||||
|
closesocket(sock);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Add table
Reference in a new issue