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 17:27:46 +08:00
committed by Gregory Nutt
parent 9f9566c0eb
commit 0b860726db
7 changed files with 4 additions and 14 deletions
+1 -2
View File
@@ -408,8 +408,7 @@ int rpcclnt_connect(struct rpcclnt *rpc)
return errval;
}
so->s_crefs = 1;
rpc->rc_so = so;
rpc->rc_so = so;
/* Always set receive timeout to detect server crash and reconnect.
* Otherwise, we can get stuck in psock_receive forever.
-4
View File
@@ -1370,8 +1370,6 @@ static int userfs_bind(FAR struct inode *blkdriver, FAR const void *data,
goto errout_with_alloc;
}
priv->psock.s_crefs = 1;
/* Bind the socket to the client address */
client.sin_family = AF_INET;
@@ -1386,8 +1384,6 @@ static int userfs_bind(FAR struct inode *blkdriver, FAR const void *data,
goto errout_with_psock;
}
priv->psock.s_crefs = 1;
/* Mounted! */
*handle = (FAR void *)priv;