Include assert.h for DEBUGASSERT caller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
d3f8f423d5
commit
1ee948e0c8
@ -32,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#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;
|
||||
|
@ -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);
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <libgen.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <libgen.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <net/if.h>
|
||||
@ -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;
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <net/if.h>
|
||||
@ -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;
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
@ -50,6 +50,7 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include <signal.h>
|
||||
#include <semaphore.h>
|
||||
#include <sched.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "nsh.h"
|
||||
#include "nsh_console.h"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include <fcntl.h> /* Needed for open */
|
||||
#include <dirent.h>
|
||||
#include <libgen.h> /* Needed for basename */
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef CONFIG_NSH_CLE
|
||||
# include "system/cle.h"
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sched.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -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 <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
#include <assert.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
Loading…
Reference in New Issue
Block a user