[LWIP] fixed closesocket issues: socket has been closed, delete it from file system fd.

This commit is contained in:
aozima 2017-12-11 17:25:25 +08:00
parent c77cebc4c0
commit a2d1f21b43
1 changed files with 7 additions and 0 deletions

View File

@ -327,6 +327,13 @@ RTM_EXPORT(socket);
int closesocket(int s)
{
int sock = dfs_net_getsocket(s);
struct dfs_fd *d;
d = fd_get(s);
/* socket has been closed, delete it from file system fd */
fd_put(d);
fd_put(d);
return lwip_close(sock);
}