diff --git a/net/inet/inet_close.c b/net/inet/inet_close.c index 6ebf3d4514..3861131805 100644 --- a/net/inet/inet_close.c +++ b/net/inet/inet_close.c @@ -421,7 +421,6 @@ static inline int udp_close(FAR struct socket *psock) struct timespec abstime; bool linger; #endif - int ret; /* Interrupts are disabled here to avoid race conditions */ @@ -446,6 +445,8 @@ static inline int udp_close(FAR struct socket *psock) linger = _SO_GETOPT(psock->s_options, SO_LINGER); if (linger) { + int ret; + /* Get the current time */ ret = clock_gettime(CLOCK_REALTIME, &abstime); diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index 3088559436..0f7d52a8c3 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -1758,7 +1758,7 @@ struct timespec; int tcp_txdrain(FAR struct socket *psock, FAR const struct timespec *abstime); #else -# define udp_txdrain(conn, abstime) (0) +# define tcp_txdrain(conn, abstime) (0) #endif #undef EXTERN