mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Ensure psock_socket and psock_accept initialize s_crefs to 1
This simplifies the caller usage
This commit is contained in:
+1
-2
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user