Ensure psock_socket and psock_accept initialize s_crefs to 1

This simplifies the caller usage
This commit is contained in:
Xiang Xiao
2020-01-31 13:45:14 -06:00
committed by Gregory Nutt
parent 9f9566c0eb
commit 0b860726db
7 changed files with 4 additions and 14 deletions
+1
View File
@@ -879,6 +879,7 @@ static int inet_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
/* Initialize the socket structure. */
newsock->s_crefs = 1;
newsock->s_domain = psock->s_domain;
newsock->s_type = SOCK_STREAM;
newsock->s_sockif = psock->s_sockif;