Commit 88a0476c authored by Python1320's avatar Python1320
Browse files

Push errors aside to get to linker errors

parent b8c4b617
......@@ -86,7 +86,7 @@ int dns_gethostip_multi(FAR const char *hostname, FAR in_addr_t *ipaddr,
if (nipaddr == 0 || !ipaddr)
{
errno = EINVAL;
set_errno ( EINVAL );
return ret;
}
......@@ -96,7 +96,7 @@ int dns_gethostip_multi(FAR const char *hostname, FAR in_addr_t *ipaddr,
ret = dns_query_sock_multi(sockfd, hostname, ipaddr, nipaddr);
err = errno;
dns_free_sock(&sockfd);
errno = err;
set_errno( err );
}
return ret;
......
......@@ -278,7 +278,7 @@ static uint16_t transform_16bit(uint16_t ctr)
if (!g.init)
{
speckrandom_buf(&g.rand, sizeof(g.rand));
//speckrandom_buf(&g.rand, sizeof(g.rand));
g.init = true;
}
......@@ -404,7 +404,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
{
/* Too long name! */
errno = EMSGSIZE;
set_errno(EMSGSIZE);
return ERROR;
}
......@@ -416,7 +416,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
{
/* Too long name! */
errno = EMSGSIZE;
set_errno(EMSGSIZE);
return ERROR;
}
......@@ -432,7 +432,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
{
/* Too long name! */
errno = EMSGSIZE;
set_errno(EMSGSIZE);
return ERROR;
}
......@@ -448,7 +448,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
{
/* Too long name! */
errno = EMSGSIZE;
set_errno(EMSGSIZE);
return ERROR;
}
......@@ -463,7 +463,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
{
/* Out of memory. */
errno = ENOMEM;
set_errno(ENOMEM);
return ERROR;
}
......@@ -485,7 +485,7 @@ static int dns_send_query(int sockfd, FAR const char *name,
int err = errno;
free(qinfo->qname);
qinfo->qname = NULL;
errno = err;
set_errno(err);
}
return wlen;
......@@ -534,7 +534,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
/* Not response from DNS server. */
ndbg("packet from wrong address\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -543,7 +543,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
/* Not response from DNS server. */
ndbg("packet from wrong port\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -554,7 +554,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
ndbg("too short DNS response (len: %d, expect at least: %d)\n",
buflen, sizeof(*hdr));
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -571,7 +571,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
if ((hdr->flags2 & DNS_FLAG2_ERR_MASK) != 0)
{
errno = EHOSTUNREACH;
set_errno(EHOSTUNREACH);
return ERROR;
}
......@@ -582,7 +582,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
ndbg("wrong DNS response ID (expected %d, got %d).\n",
qinfo->id, hdr->id);
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -597,7 +597,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
{
ndbg("wrong number of questions (expected %d, got %d).\n", 1, nquestions);
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -642,7 +642,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
{
ndbg("invalid DNS response, response name different length than query.\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -650,7 +650,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
{
ndbg("invalid DNS response, response name mismatch query.\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -659,7 +659,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
{
ndbg("malformed DNS response, no answers section.\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -670,7 +670,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
{
ndbg("invalid DNS response, question section mismatch.\n");
errno = EBADMSG;
set_errno(EBADMSG);
return ERROR;
}
......@@ -779,7 +779,7 @@ static int dns_recv_response(int sockfd, FAR in_addr_t *inaddr, size_t naddr,
return naddr_read;
}
errno = errval;
set_errno(errval);
return ERROR;
}
......@@ -815,7 +815,7 @@ int dns_bind_sock(FAR int *sockfd)
{
err = errno;
ndbg("ERROR: socket() failed: %d\n", errno);
errno = err;
set_errno(err);
return ERROR;
}
......@@ -833,7 +833,7 @@ int dns_bind_sock(FAR int *sockfd)
ndbg("ERROR: setsockopt() failed: %d\n", errno);
close(*sockfd);
*sockfd = -1;
errno = err;
set_errno(err);
return ERROR;
}
......@@ -920,7 +920,7 @@ int dns_query_sock_multi(int sockfd, FAR const char *hostname,
if (!ipaddr || nipaddr == 0)
{
errno = EINVAL;
set_errno(EINVAL);
return ERROR;
}
......@@ -1208,7 +1208,7 @@ int dns_whois_socket_multi(int sockfd, FAR const char *name,
if (naddr == 0 || !addr)
{
errno = EINVAL;
set_errno(EINVAL);
return ERROR;
}
......@@ -1285,6 +1285,6 @@ int dns_whois_socket_multi(int sockfd, FAR const char *name,
err_out:
free(buffer);
dns_increase_lookup_failed_count();
errno = err;
set_errno(err);
return ERROR;
}
......@@ -1356,7 +1356,12 @@ CONFIG_CODECS_BASE64=y
CONFIG_NETUTILS_CODECS=y
# CONFIG_NETUTILS_DHCPD is not set
# CONFIG_NETUTILS_DISCOVER is not set
# CONFIG_NETUTILS_DNSCLIENT is not set
CONFIG_NETUTILS_DNSCLIENT=y
CONFIG_NETUTILS_DNSCLIENT_ENTRIES=8
CONFIG_NETUTILS_DNSCLIENT_IPv4=y
CONFIG_NETUTILS_DNSCLIENT_MAXRESPONSE=96
CONFIG_NETUTILS_DNSCLIENT_RECV_TIMEOUT=30
CONFIG_NETUTILS_DNSCLIENT_RETRIES=3
# CONFIG_NETUTILS_FTPC is not set
# CONFIG_NETUTILS_FTPD is not set
CONFIG_NETUTILS_JSON=y
......@@ -1488,6 +1493,7 @@ CONFIG_NSH_ARCHINIT=y
#
# IPv4 Addresses
#
# CONFIG_NSH_DNS is not set
CONFIG_NSH_DRIPADDR=0x0a000001
CONFIG_NSH_IPADDR=0x0a000002
CONFIG_NSH_MAX_ROUNDTRIP=20
......@@ -1557,3 +1563,7 @@ CONFIG_SYSTEM_READLINE=y
# CONFIG_TESTS_UNITY_RAMTEST is not set
# CONFIG_TESTS_UNITY_USRSOCK is not set
/************************************************************************
/****************************************************************************
* include/errno.h
*
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
......@@ -31,20 +31,20 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************/
****************************************************************************/
#ifndef __INCLUDE_ERRNO_H
#define __INCLUDE_ERRNO_H
/************************************************************************
/****************************************************************************
* Included Files
************************************************************************/
****************************************************************************/
#include <nuttx/compiler.h>
/************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************/
****************************************************************************/
/* How can we access the errno variable? */
#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
......@@ -378,13 +378,13 @@
#define ECANCELED 125
#define ECANCELED_STR "Operation cancelled"
/************************************************************************
* Type Declarations
************************************************************************/
/****************************************************************************
* Public Type Definitions
****************************************************************************/
/************************************************************************
* Global Function Prototypes
************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
......
......@@ -159,13 +159,13 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
/* Special handling for NaN and Infinity */
if (isnan(value))
if (value!=value)
{
lib_dtoa_string(obj, "NaN");
return;
}
if (isinf(value))
if (value>1e10 || value < -1e10)
{
if (value < 0.0)
{
......
......@@ -60,10 +60,7 @@ static void lowoutstream_putc(FAR struct lib_outstream_s *this, int ch)
{
DEBUGASSERT(this);
if (up_putc(ch) != EOF)
{
this->nput++;
}
}
/****************************************************************************
......
......@@ -93,7 +93,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
* syslog_putc returns EOF with the errno value set;
*/
ret = syslog_putc(ch);
ret = 1; // syslog_putc(ch);
if (ret != EOF)
{
this->nput++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment