From 3ba9dda227a0a9c54d60bf254de0518aa25f4318 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 12 Mar 2015 08:11:08 -0600 Subject: [PATCH] socket: net_dupsd: Do not call sockfd_socket() twice. From Juha Niskanen --- net/socket/net_dupsd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/socket/net_dupsd.c b/net/socket/net_dupsd.c index 480b68f37fb..0af6fce57db 100644 --- a/net/socket/net_dupsd.c +++ b/net/socket/net_dupsd.c @@ -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. */