diff --git a/examples/rpmsgsocket/rpsock_server.c b/examples/rpmsgsocket/rpsock_server.c index 001d9dbef..da8194bb3 100644 --- a/examples/rpmsgsocket/rpsock_server.c +++ b/examples/rpmsgsocket/rpsock_server.c @@ -32,6 +32,7 @@ #include #include #include +#include #include /**************************************************************************** diff --git a/fsutils/passwd/passwd_find.c b/fsutils/passwd/passwd_find.c index 4e737eca1..c30232f4d 100644 --- a/fsutils/passwd/passwd_find.c +++ b/fsutils/passwd/passwd_find.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include "passwd.h" @@ -110,7 +111,7 @@ int passwd_find(FAR const char *username, FAR struct passwd_s *passwd) offset = 0; ret = -ENOENT; - while (fgets(iobuffer, CONFIG_FSUTILS_PASSWD_IOBUFFER_SIZE, stream) != NULL) + while (fgets(iobuffer, CONFIG_FSUTILS_PASSWD_IOBUFFER_SIZE, stream)) { ptr = iobuffer; name = ptr; diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c index 939da5bed..5c834d2da 100644 --- a/netutils/dhcpd/dhcpd.c +++ b/netutils/dhcpd/dhcpd.c @@ -1629,7 +1629,6 @@ int dhcpd_start(FAR const char *interface) if (pid < 0) { int errval = errno; - DEBUGASSERT(errval > 0); g_dhcpd_daemon.ds_state = DHCPD_STOPPED; nerr("ERROR: Failed to start the DHCPD daemon: %d\n", errval); diff --git a/netutils/ftpc/ftpc_getfile.c b/netutils/ftpc/ftpc_getfile.c index dd2ca62ca..8bb38b463 100644 --- a/netutils/ftpc/ftpc_getfile.c +++ b/netutils/ftpc/ftpc_getfile.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/netutils/ftpc/ftpc_listdir.c b/netutils/ftpc/ftpc_listdir.c index 213ed2268..9019b0dae 100644 --- a/netutils/ftpc/ftpc_listdir.c +++ b/netutils/ftpc/ftpc_listdir.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/netutils/ftpc/ftpc_putfile.c b/netutils/ftpc/ftpc_putfile.c index dbb1f8fb2..dc50000bd 100644 --- a/netutils/ftpc/ftpc_putfile.c +++ b/netutils/ftpc/ftpc_putfile.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/netutils/ftpc/ftpc_socket.c b/netutils/ftpc/ftpc_socket.c index d1f19d7a3..12520ffa4 100644 --- a/netutils/ftpc/ftpc_socket.c +++ b/netutils/ftpc/ftpc_socket.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -148,8 +149,9 @@ errout: void ftpc_sockclose(FAR struct ftpc_socket_s *sock) { - /* Note that the same underlying socket descriptor is used for both streams. - * There should be harmless failures on the second fclose and the close. + /* Note that the same underlying socket descriptor is used for both + * streams. There should be harmless failures on the second fclose + * and the close. */ fclose(sock->instream); @@ -168,7 +170,8 @@ void ftpc_sockclose(FAR struct ftpc_socket_s *sock) * ****************************************************************************/ -int ftpc_sockconnect(FAR struct ftpc_socket_s *sock, FAR struct sockaddr *addr) +int ftpc_sockconnect(FAR struct ftpc_socket_s *sock, + FAR struct sockaddr *addr) { int ret; @@ -177,14 +180,16 @@ int ftpc_sockconnect(FAR struct ftpc_socket_s *sock, FAR struct sockaddr *addr) #ifdef CONFIG_NET_IPv6 if (addr->sa_family == AF_INET6) { - ret = connect(sock->sd, (struct sockaddr *)addr, sizeof(struct sockaddr_in6)); + ret = connect(sock->sd, (struct sockaddr *)addr, + sizeof(struct sockaddr_in6)); } else #endif #ifdef CONFIG_NET_IPv4 if (addr->sa_family == AF_INET) { - ret = connect(sock->sd, (struct sockaddr *)addr, sizeof(struct sockaddr_in)); + ret = connect(sock->sd, (struct sockaddr *)addr, + sizeof(struct sockaddr_in)); } else #endif @@ -234,21 +239,21 @@ void ftpc_sockcopy(FAR struct ftpc_socket_s *dest, * Accept a connection on the data socket. This function is only used * in active mode. * - * In active mode FTP the client connects from a random port (N>1023) to the - * FTP server's command port, port 21. Then, the client starts listening to - * port N+1 and sends the FTP command PORT N+1 to the FTP server. The server - * will then connect back to the client's specified data port from its local - * data port, which is port 20. In passive mode FTP the client initiates - * both connections to the server, solving the problem of firewalls filtering - * the incoming data port connection to the client from the server. When - * opening an FTP connection, the client opens two random ports locally - * (N>1023 and N+1). The first port contacts the server on port 21, but - * instead of then issuing a PORT command and allowing the server to connect - * back to its data port, the client will issue the PASV command. The result - * of this is that the server then opens a random unprivileged port (P > - * 1023) and sends the PORT P command back to the client. The client then - * initiates the connection from port N+1 to port P on the server to transfer - * data. + * In active mode FTP the client connects from a random port (N>1023) to + * the FTP server's command port, port 21. Then, the client starts + * listening to port N+1 and sends the FTP command PORT N+1 to the FTP + * server. The server will then connect back to the client's specified data + * port from its local data port, which is port 20. In passive mode FTP the + * client initiates both connections to the server, solving the problem of + * firewalls filtering the incoming data port connection to the client from + * the server. When opening an FTP connection, the client opens two random + * ports locally (N>1023 and N+1). The first port contacts the server on + * port 21, but instead of then issuing a PORT command and allowing the + * server to connect back to its data port, the client will issue the PASV + * command. The result of this is that the server then opens a random + * unprivileged port (P > 1023) and sends the PORT P command back to the + * client. The client then initiates the connection from port N+1 to port P + * on the server to transfer data. * ****************************************************************************/ @@ -318,7 +323,7 @@ errout_with_sd: * Name: ftpc_socklisten * * Description: - * Bind the socket to local address and wait for connection from the server. + * Bind the socket to local address and wait for connection from server. * ****************************************************************************/ @@ -411,5 +416,6 @@ int ftpc_sockgetsockname(FAR struct ftpc_socket_s *sock, nerr("ERROR: getsockname failed: %d\n", errno); return ERROR; } + return OK; } diff --git a/netutils/netlib/netlib_ipv4adaptor.c b/netutils/netlib/netlib_ipv4adaptor.c index 8b99ec2c3..9024a5a0f 100644 --- a/netutils/netlib/netlib_ipv4adaptor.c +++ b/netutils/netlib/netlib_ipv4adaptor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * netutils/netlib/netlib_ipv4adaptor.c + * apps/netutils/netlib/netlib_ipv4adaptor.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -87,7 +88,8 @@ * ****************************************************************************/ -static int _netlib_ipv4adaptor(in_addr_t destipaddr, FAR in_addr_t *srcipaddr) +static int _netlib_ipv4adaptor(in_addr_t destipaddr, + FAR in_addr_t *srcipaddr) { FAR struct ifreq *ifr; struct ifconf ifc; diff --git a/netutils/netlib/netlib_ipv6adaptor.c b/netutils/netlib/netlib_ipv6adaptor.c index aa734ce83..05a7b9e7c 100644 --- a/netutils/netlib/netlib_ipv6adaptor.c +++ b/netutils/netlib/netlib_ipv6adaptor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * netutils/netlib/netlib_ipv6adaptor.c + * apps/netutils/netlib/netlib_ipv6adaptor.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -179,7 +180,8 @@ static int _netlib_ipv6adaptor(FAR const struct in6_addr *destipaddr, strncpy(maskreq.lifr_name, lifr->lifr_name, IFNAMSIZ); - status = ioctl(sd, SIOCGLIFNETMASK, (unsigned long)((uintptr_t)&maskreq)); + status = ioctl(sd, SIOCGLIFNETMASK, + (unsigned long)((uintptr_t)&maskreq)); if (status < 0) { ret = -errno; diff --git a/netutils/ntpclient/ntpclient.c b/netutils/ntpclient/ntpclient.c index cdaf1b18b..4140a186f 100644 --- a/netutils/ntpclient/ntpclient.c +++ b/netutils/ntpclient/ntpclient.c @@ -1,5 +1,5 @@ /**************************************************************************** - * netutils/ntpclient/ntpclient.c + * apps/netutils/ntpclient/ntpclient.c * * Copyright (C) 2014, 2016, 2020 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ #include #include #include +#include #include #include diff --git a/netutils/telnetd/telnetd_daemon.c b/netutils/telnetd/telnetd_daemon.c index 94fc2f19e..dca485e0b 100644 --- a/netutils/telnetd/telnetd_daemon.c +++ b/netutils/telnetd/telnetd_daemon.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 9d8cf278b..b20d803af 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -47,6 +47,7 @@ #include #include #include +#include #include "nsh.h" #include "nsh_console.h" diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index d4633e10c..c518b4ae3 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -56,6 +56,7 @@ #include /* Needed for open */ #include #include /* Needed for basename */ +#include #include #include diff --git a/nshlib/nsh_session.c b/nshlib/nsh_session.c index 2f28412e9..9379df0a6 100644 --- a/nshlib/nsh_session.c +++ b/nshlib/nsh_session.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef CONFIG_NSH_CLE # include "system/cle.h" diff --git a/system/taskset/taskset.c b/system/taskset/taskset.c index 1135c5318..ea6d5ec0c 100644 --- a/system/taskset/taskset.c +++ b/system/taskset/taskset.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/testing/getprime/getprime_main.c b/testing/getprime/getprime_main.c index b72b50e2e..5b219bcb4 100644 --- a/testing/getprime/getprime_main.c +++ b/testing/getprime/getprime_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/getprime_main.c + * apps/testing/getprime/getprime_main.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -30,6 +30,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions