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 0b8248b33c
commit 3ba9dda227
1 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@
* Function: net_dupsd * Function: net_dupsd
* *
* Description: * 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 * descriptors are implemented, then this is called by dup() for the case
* of socket file descriptors. If file descriptors are not implemented, * of socket file descriptors. If file descriptors are not implemented,
* then this function IS dup(). * then this function IS dup().
@ -69,14 +69,14 @@
int net_dupsd(int sockfd, int minsd) int net_dupsd(int sockfd, int minsd)
{ {
FAR struct socket *psock1 = sockfd_socket(sockfd); FAR struct socket *psock1;
FAR struct socket *psock2; FAR struct socket *psock2;
int sockfd2; int sockfd2;
int err; int err;
int ret; int ret;
/* Make sure that the minimum socket descriptor is within the legal range. /* 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. * map it relative of the first socket descriptor.
*/ */