summaryrefslogtreecommitdiff
path: root/components/net/sal_socket/src/sal_socket.c
diff options
context:
space:
mode:
authorWayne Lin <[email protected]>2020-05-15 09:41:27 +0800
committerWayne Lin <[email protected]>2020-05-15 09:41:27 +0800
commit5d65fe074f0e0ba53673ffef6205aab6baa76d0a (patch)
tree9847ae8364cbd3c7cec8168ba75e2c5cb15a8a41 /components/net/sal_socket/src/sal_socket.c
parent39431f5a702f3dcec843cb8884064953594243ec (diff)
parentdab737f6375f5cdd86ad3bc6d166657b17364948 (diff)
Merge branch 'master' of https://github.com/rt-thread/rt-thread into rtt_issues
Diffstat (limited to 'components/net/sal_socket/src/sal_socket.c')
-rw-r--r--components/net/sal_socket/src/sal_socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c
index e5c55f8bf8..e3bea5a28e 100644
--- a/components/net/sal_socket/src/sal_socket.c
+++ b/components/net/sal_socket/src/sal_socket.c
@@ -679,7 +679,7 @@ int sal_shutdown(int socket, int how)
/* get the socket object by socket descriptor */
SAL_SOCKET_OBJ_GET(sock, socket);
- /* shutdown operation not nead to check network interface status */
+ /* shutdown operation not need to check network interface status */
/* check the network interface socket opreation */
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, shutdown);
@@ -924,6 +924,7 @@ int sal_socket(int domain, int type, int protocol)
sock = sal_get_socket(socket);
if (sock == RT_NULL)
{
+ socket_delete(socket);
return -1;
}
@@ -956,7 +957,7 @@ int sal_socket(int domain, int type, int protocol)
sock->user_data = (void *) proto_socket;
return sock->socket;
}
-
+ socket_delete(socket);
return -1;
}
@@ -969,7 +970,7 @@ int sal_closesocket(int socket)
/* get the socket object by socket descriptor */
SAL_SOCKET_OBJ_GET(sock, socket);
- /* clsoesocket operation not nead to vaild network interface status */
+ /* clsoesocket operation not need to vaild network interface status */
/* valid the network interface socket opreation */
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, socket);