9
0
Fork 0

socket: net_dupsd: Do not call sockfd_socket() twice. From Juha Niskanen

This commit is contained in:
Gregory Nutt 2015-03-12 08:11:08 -06:00
parent a4b3285de1
commit 838f9ac3ea
1 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@
* Function: net_dupsd
*
* Description:
* Clone a socket descriptor to an arbitray descriptor number. If file
* Clone a socket descriptor to an arbitrary descriptor number. If file
* descriptors are implemented, then this is called by dup() for the case
* of socket file descriptors. If file descriptors are not implemented,
* then this function IS dup().
@ -69,14 +69,14 @@
int net_dupsd(int sockfd, int minsd)
{
FAR struct socket *psock1 = sockfd_socket(sockfd);
FAR struct socket *psock1;
FAR struct socket *psock2;
int sockfd2;
int err;
int ret;
/* Make sure that the minimum socket descriptor is within the legal range.
* the minimum value we receive is relative to file descriptor 0; we need
* The minimum value we receive is relative to file descriptor 0; we need
* map it relative of the first socket descriptor.
*/