mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 12:09:25 +08:00
Update to FreeBSD head 2017-01-09
Git mirror commit 1f8e4a995a6ede4bdb24e6d335ccda2bdb0175ab.
This commit is contained in:
@@ -276,6 +276,8 @@ void _malloc_thread_cleanup(void);
|
||||
* thread is exiting, so its thread-local dtors should be called.
|
||||
*/
|
||||
void __cxa_thread_call_dtors(void);
|
||||
int __cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj,
|
||||
void *dso_symbol) __hidden;
|
||||
|
||||
/*
|
||||
* These functions are used by the threading libraries in order to protect
|
||||
|
@@ -693,9 +693,8 @@ reorder(struct addrinfo *sentinel)
|
||||
return(n);
|
||||
|
||||
/* allocate a temporary array for sort and initialization of it. */
|
||||
if ((aio = malloc(sizeof(*aio) * n)) == NULL)
|
||||
if ((aio = calloc(n, sizeof(*aio))) == NULL)
|
||||
return(n); /* give up reordering */
|
||||
memset(aio, 0, sizeof(*aio) * n);
|
||||
|
||||
/* retrieve address selection policy from the kernel */
|
||||
TAILQ_INIT(&policyhead);
|
||||
@@ -1451,9 +1450,8 @@ copy_ai(const struct addrinfo *pai)
|
||||
size_t l;
|
||||
|
||||
l = sizeof(*ai) + pai->ai_addrlen;
|
||||
if ((ai = (struct addrinfo *)malloc(l)) == NULL)
|
||||
if ((ai = calloc(1, l)) == NULL)
|
||||
return NULL;
|
||||
memset(ai, 0, l);
|
||||
memcpy(ai, pai, sizeof(*ai));
|
||||
ai->ai_addr = (struct sockaddr *)(void *)(ai + 1);
|
||||
memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen);
|
||||
@@ -1876,8 +1874,7 @@ addrinfo_unmarshal_func(char *buffer, size_t buffer_size, void *retval,
|
||||
size = new_ai.ai_addrlen + sizeof(struct addrinfo) +
|
||||
_ALIGNBYTES;
|
||||
|
||||
sentinel = (struct addrinfo *)malloc(size);
|
||||
memset(sentinel, 0, size);
|
||||
sentinel = calloc(1, size);
|
||||
|
||||
memcpy(sentinel, &new_ai, sizeof(struct addrinfo));
|
||||
sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel +
|
||||
@@ -1890,8 +1887,7 @@ addrinfo_unmarshal_func(char *buffer, size_t buffer_size, void *retval,
|
||||
memcpy(&size, p, sizeof(size_t));
|
||||
p += sizeof(size_t);
|
||||
|
||||
sentinel->ai_canonname = (char *)malloc(size + 1);
|
||||
memset(sentinel->ai_canonname, 0, size + 1);
|
||||
sentinel->ai_canonname = calloc(1, size + 1);
|
||||
|
||||
memcpy(sentinel->ai_canonname, p, size);
|
||||
p += size;
|
||||
|
@@ -550,13 +550,6 @@ char *_nsyytext;
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
@@ -588,7 +581,7 @@ static char *rcsid =
|
||||
#include "nsparser.h"
|
||||
|
||||
#define YY_NO_INPUT 1
|
||||
#line 592 "<stdout>"
|
||||
#line 585 "<stdout>"
|
||||
|
||||
#define INITIAL 0
|
||||
|
||||
@@ -768,10 +761,10 @@ YY_DECL
|
||||
char *yy_cp, *yy_bp;
|
||||
int yy_act;
|
||||
|
||||
#line 66 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 59 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
|
||||
|
||||
#line 775 "<stdout>"
|
||||
#line 768 "<stdout>"
|
||||
|
||||
if ( !(yy_init) )
|
||||
{
|
||||
@@ -866,59 +859,59 @@ do_action: /* This label is used only to access EOF actions. */
|
||||
|
||||
case 1:
|
||||
YY_RULE_SETUP
|
||||
#line 68 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 61 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
; /* skip whitespace */
|
||||
YY_BREAK
|
||||
case 2:
|
||||
YY_RULE_SETUP
|
||||
#line 70 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 63 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
; /* skip comments */
|
||||
YY_BREAK
|
||||
case 3:
|
||||
/* rule 3 can match eol */
|
||||
YY_RULE_SETUP
|
||||
#line 72 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 65 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
; /* allow continuation */
|
||||
YY_BREAK
|
||||
case 4:
|
||||
/* rule 4 can match eol */
|
||||
YY_RULE_SETUP
|
||||
#line 74 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 67 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return NL;
|
||||
YY_BREAK
|
||||
case 5:
|
||||
YY_RULE_SETUP
|
||||
#line 76 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 69 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return SUCCESS;
|
||||
YY_BREAK
|
||||
case 6:
|
||||
YY_RULE_SETUP
|
||||
#line 77 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 70 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return UNAVAIL;
|
||||
YY_BREAK
|
||||
case 7:
|
||||
YY_RULE_SETUP
|
||||
#line 78 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 71 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return NOTFOUND;
|
||||
YY_BREAK
|
||||
case 8:
|
||||
YY_RULE_SETUP
|
||||
#line 79 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 72 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return TRYAGAIN;
|
||||
YY_BREAK
|
||||
case 9:
|
||||
YY_RULE_SETUP
|
||||
#line 81 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 74 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return RETURN;
|
||||
YY_BREAK
|
||||
case 10:
|
||||
YY_RULE_SETUP
|
||||
#line 82 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 75 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return CONTINUE;
|
||||
YY_BREAK
|
||||
case 11:
|
||||
YY_RULE_SETUP
|
||||
#line 84 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 77 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
{
|
||||
char *p;
|
||||
int i;
|
||||
@@ -938,15 +931,15 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 12:
|
||||
YY_RULE_SETUP
|
||||
#line 101 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 94 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
return _nsyytext[0];
|
||||
YY_BREAK
|
||||
case 13:
|
||||
YY_RULE_SETUP
|
||||
#line 103 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 96 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 950 "<stdout>"
|
||||
#line 943 "<stdout>"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
yyterminate();
|
||||
|
||||
@@ -1911,20 +1904,19 @@ void _nsyyfree (void * ptr )
|
||||
|
||||
#define YYTABLES_NAME "yytables"
|
||||
|
||||
#line 103 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
#line 96 "../../freebsd/lib/libc/net/nslexer.l"
|
||||
|
||||
|
||||
|
||||
#undef _nsyywrap
|
||||
int
|
||||
_nsyywrap()
|
||||
_nsyywrap(void)
|
||||
{
|
||||
return 1;
|
||||
} /* _nsyywrap */
|
||||
|
||||
void
|
||||
_nsyyerror(msg)
|
||||
const char *msg;
|
||||
_nsyyerror(const char *msg)
|
||||
{
|
||||
|
||||
syslog(LOG_ERR, "NSSWITCH(nslexer): %s line %d: %s at '%s'",
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
#define YYMINOR 9
|
||||
#define YYPATCH 20160324
|
||||
|
||||
#define YYEMPTY (-1)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
@@ -114,13 +115,6 @@
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
@@ -151,7 +145,7 @@ static void _nsaddsrctomap(const char *);
|
||||
|
||||
static ns_dbt curdbt;
|
||||
static ns_src cursrc;
|
||||
#line 58 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 51 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#ifdef YYSTYPE
|
||||
#undef YYSTYPE_IS_DECLARED
|
||||
#define YYSTYPE_IS_DECLARED 1
|
||||
@@ -163,7 +157,7 @@ typedef union {
|
||||
int mapval;
|
||||
} YYSTYPE;
|
||||
#endif /* !YYSTYPE_IS_DECLARED */
|
||||
#line 167 "_nsyy.tab.c"
|
||||
#line 161 "_nsyy.tab.c"
|
||||
|
||||
/* compatibility with bison */
|
||||
#ifdef YYPARSE_PARAM
|
||||
@@ -206,7 +200,7 @@ extern int YYPARSE_DECL();
|
||||
#define ERRORTOKEN 264
|
||||
#define STRING 265
|
||||
#define YYERRCODE 256
|
||||
typedef short YYINT;
|
||||
typedef int YYINT;
|
||||
static const YYINT _nsyylhs[] = { -1,
|
||||
0, 0, 3, 3, 4, 4, 4, 4, 5, 6,
|
||||
6, 7, 9, 7, 8, 8, 10, 1, 1, 1,
|
||||
@@ -362,11 +356,10 @@ typedef struct {
|
||||
} YYSTACKDATA;
|
||||
/* variables for the parser stack */
|
||||
static YYSTACKDATA yystack;
|
||||
#line 153 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 146 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
|
||||
static void
|
||||
_nsaddsrctomap(elem)
|
||||
const char *elem;
|
||||
_nsaddsrctomap(const char *elem)
|
||||
{
|
||||
int i, lineno;
|
||||
extern int _nsyylineno;
|
||||
@@ -396,7 +389,7 @@ _nsaddsrctomap(elem)
|
||||
cursrc.name = elem;
|
||||
_nsdbtaddsrc(&curdbt, &cursrc);
|
||||
}
|
||||
#line 400 "_nsyy.tab.c"
|
||||
#line 393 "_nsyy.tab.c"
|
||||
|
||||
#if YYDEBUG
|
||||
#include <stdio.h> /* needed for printf */
|
||||
@@ -599,25 +592,25 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 6:
|
||||
#line 86 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 79 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
free((char*)curdbt.name);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
#line 90 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 83 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
_nsdbtput(&curdbt);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
#line 94 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 87 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
yyerrok;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
#line 101 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 94 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
curdbt.name = yylval.str;
|
||||
curdbt.srclist = NULL;
|
||||
@@ -625,24 +618,24 @@ case 9:
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
#line 115 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 108 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
cursrc.flags = NS_TERMINATE;
|
||||
_nsaddsrctomap(yystack.l_mark[0].str);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
#line 119 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 112 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ cursrc.flags = NS_SUCCESS; }
|
||||
break;
|
||||
case 14:
|
||||
#line 120 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 113 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
_nsaddsrctomap(yystack.l_mark[-4].str);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
#line 132 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 125 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{
|
||||
if (yystack.l_mark[0].mapval) /* if action == RETURN set RETURN bit */
|
||||
cursrc.flags |= yystack.l_mark[-2].mapval;
|
||||
@@ -651,30 +644,30 @@ case 17:
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
#line 141 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 134 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_SUCCESS; }
|
||||
break;
|
||||
case 19:
|
||||
#line 142 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 135 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_UNAVAIL; }
|
||||
break;
|
||||
case 20:
|
||||
#line 143 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 136 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_NOTFOUND; }
|
||||
break;
|
||||
case 21:
|
||||
#line 144 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 137 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_TRYAGAIN; }
|
||||
break;
|
||||
case 22:
|
||||
#line 148 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 141 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_ACTION_RETURN; }
|
||||
break;
|
||||
case 23:
|
||||
#line 149 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
#line 142 "../../freebsd/lib/libc/net/nsparser.y"
|
||||
{ yyval.mapval = NS_ACTION_CONTINUE; }
|
||||
break;
|
||||
#line 678 "_nsyy.tab.c"
|
||||
#line 671 "_nsyy.tab.c"
|
||||
}
|
||||
yystack.s_mark -= yym;
|
||||
yystate = *yystack.s_mark;
|
||||
|
Reference in New Issue
Block a user