Skip to content

Commit

Permalink
Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
Browse files Browse the repository at this point in the history
 - Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <[email protected])
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
  • Loading branch information
sambuc committed Jul 28, 2014
1 parent ff10274 commit 84d9c62
Show file tree
Hide file tree
Showing 4,712 changed files with 400,139 additions and 171,881 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
64 changes: 40 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.299 2012/08/17 16:22:27 joerg Exp $
# $NetBSD: Makefile,v 1.303 2013/07/16 09:52:21 joerg Exp $

#
# This is the top-level makefile for building NetBSD. For an outline of
Expand Down Expand Up @@ -87,11 +87,11 @@
# do-top-obj: creates the top level object directory.
# do-tools-obj: creates object directories for the host toolchain.
# do-tools: builds host toolchain.
# params: record the values of variables that might affect the
# build.
# obj: creates object directories.
# do-distrib-dirs: creates the distribution directories.
# includes: installs include files.
# do-tools-compat: builds the "libnbcompat" library; needed for some
# random host tool programs in the source tree.
# do-lib: builds and installs prerequisites from lib
# if ${MKCOMPAT} != "no".
# do-compat-lib: builds and installs prerequisites from compat/lib
Expand Down Expand Up @@ -137,15 +137,14 @@ _SRC_TOP_OBJ_=
# _SUBDIR is used to set SUBDIR, after removing directories that have
# BUILD_${dir}=no, or that have no ${dir}/Makefile.
#
_SUBDIR= tools lib .WAIT include gnu external crypto/external bin games
_SUBDIR+= libexec sbin usr.bin
_SUBDIR+= commands man
_SUBDIR+= common drivers kernel servers
_SUBDIR+= usr.sbin share rescue sys etc test tests compat .WAIT distrib regress

_SUBDIR= tools lib include gnu external crypto/external bin games
.if defined(__MINIX)
_SUBDIR+= benchmarks
.endif
_SUBDIR+= commands man benchmarks test
_SUBDIR+= kernel servers drivers
.endif # defined(__MINIX)
_SUBDIR+= libexec sbin usr.bin
_SUBDIR+= usr.sbin share sys etc tests compat
_SUBDIR+= .WAIT rescue .WAIT distrib regress

.for dir in ${_SUBDIR}
.if "${dir}" == ".WAIT" \
Expand Down Expand Up @@ -232,6 +231,7 @@ BUILDTARGETS+= do-tools-obj
.endif
BUILDTARGETS+= do-tools
.endif # USETOOLS # }
BUILDTARGETS+= params
.if ${MKOBJDIRS} != "no"
BUILDTARGETS+= obj
.endif
Expand Down Expand Up @@ -264,6 +264,32 @@ BUILDTARGETS+= do-obsolete
includes-lib: .PHONY includes-include includes-sys
includes-gnu: .PHONY includes-lib

#
# Record the values of variables that might affect the build.
# If no values have changed, avoid updating the timestamp
# of the params file.
#
# This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
#
.include "${NETBSDSRCDIR}/etc/Makefile.params"
CLEANDIRFILES+= params
params: .EXEC
${_MKMSG_CREATE} params
@${PRINT_PARAMS} >${.TARGET}.new
@if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
: "params is unchanged" ; \
rm ${.TARGET}.new ; \
else \
: "params has changed or is new" ; \
mv ${.TARGET}.new ${.TARGET} ; \
fi

#
# Display current make(1) parameters
#
show-params: .PHONY .MAKE
@${PRINT_PARAMS}

#
# Build the system and install into DESTDIR.
#
Expand Down Expand Up @@ -342,7 +368,7 @@ installworld: .PHONY .MAKE
.endif
.if !defined(INSTALLWORLDDIR) || \
${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
.if (${HOST_UNAME_S} != "Minix")
.if (${HOST_UNAME_S} != "NetBSD") && (${HOST_UNAME_S} != "Minix")
@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to Minix with INSTALLWORLDDIR=/"
@false
.endif
Expand Down Expand Up @@ -468,12 +494,8 @@ do-${targ}: .PHONY ${targ}
@true
.endfor

.for dir in tools tools/compat
do-${dir:S/\//-/g}: .PHONY .MAKE
.for targ in dependall install
${MAKEDIRTARGET} ${dir} ${targ}
.endfor
.endfor
do-tools: .PHONY .MAKE
${MAKEDIRTARGET} tools build_install

do-lib: .PHONY .MAKE
${MAKEDIRTARGET} lib build_install
Expand Down Expand Up @@ -540,9 +562,3 @@ dependall-distrib depend-distrib all-distrib: .PHONY
.include <bsd.obj.mk>
.include <bsd.kernobj.mk>
.include <bsd.subdir.mk>

#
# Display current make(1) parameters
#
params: .PHONY .MAKE
${MAKEDIRTARGET} etc params
16 changes: 16 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# $NetBSD: Makefile.inc,v 1.4 2002/04/10 14:53:43 lukem Exp $

.ifndef ABSTOP
ABSTOP!= cd ${.PARSEDIR}; pwd

.if (${.PARSEDIR} == ${.CURDIR})
RELTOP:= .
.else
RELTOP:= ${.PARSEDIR:S,^${.CURDIR},,}
.endif

# you can set BSD{SRC,OBJ}DIR in Makefile.local.inc
.if exists(${ABSTOP}/Makefile.local.inc)
.include "${ABSTOP}/Makefile.local.inc"
.endif
.endif
5 changes: 3 additions & 2 deletions bin/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.22 2007/12/31 15:31:24 ad Exp $
# @(#)Makefile 8.1 (Berkeley) 5/31/93

SUBDIR= cat date df echo ed expr kill ksh ln ls \
mkdir pax pwd rm rmdir sync test stty
SUBDIR= cat date df echo ed expr \
kill ksh ln ls mkdir pax pwd rm rmdir \
stty sync test

.include <bsd.subdir.mk>
10 changes: 8 additions & 2 deletions bin/cat/cat.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $NetBSD: cat.1,v 1.34 2012/08/09 07:26:28 dholland Exp $
.\" $NetBSD: cat.1,v 1.36 2012/11/10 18:41:10 wiz Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -32,7 +32,7 @@
.\"
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
.\"
.Dd April 6, 2012
.Dd November 10, 2012
.Dt CAT 1
.Os
.Sh NAME
Expand All @@ -41,6 +41,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl beflnstuv
.Op Fl B Ar bsize
.Op Fl
.Op Ar
.Sh DESCRIPTION
Expand All @@ -65,6 +66,11 @@ is just a verbose synonym for
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl B Ar bsize
Read with a buffer size of
.Ar bsize
bytes, instead of the default buffer size which is the blocksize of the
output file.
.It Fl b
Implies the
.Fl n
Expand Down
37 changes: 22 additions & 15 deletions bin/cat/cat.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: cat.c,v 1.48 2012/03/17 23:35:28 christos Exp $ */
/* $NetBSD: cat.c,v 1.52 2012/11/19 19:41:31 christos Exp $ */

/*
* Copyright (c) 1989, 1993
Expand Down Expand Up @@ -44,7 +44,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
#else
__RCSID("$NetBSD: cat.c,v 1.48 2012/03/17 23:35:28 christos Exp $");
__RCSID("$NetBSD: cat.c,v 1.52 2012/11/19 19:41:31 christos Exp $");
#endif
#endif /* not lint */

Expand All @@ -61,11 +61,11 @@ __RCSID("$NetBSD: cat.c,v 1.48 2012/03/17 23:35:28 christos Exp $");
#include <string.h>
#include <unistd.h>

int bflag, eflag, fflag, lflag, nflag, sflag, tflag, vflag;
int rval;
const char *filename;
static int bflag, eflag, fflag, lflag, nflag, sflag, tflag, vflag;
static size_t bsize;
static int rval;
static const char *filename;

int main(int, char *[]);
void cook_args(char *argv[]);
void cook_buf(FILE *);
void raw_args(char *argv[]);
Expand All @@ -80,8 +80,11 @@ main(int argc, char *argv[])
setprogname(argv[0]);
(void)setlocale(LC_ALL, "");

while ((ch = getopt(argc, argv, "beflnstuv")) != -1)
while ((ch = getopt(argc, argv, "B:beflnstuv")) != -1)
switch (ch) {
case 'B':
bsize = (size_t)strtol(optarg, NULL, 0);
break;
case 'b':
bflag = nflag = 1; /* -b implies -n */
break;
Expand Down Expand Up @@ -112,9 +115,9 @@ main(int argc, char *argv[])
default:
case '?':
(void)fprintf(stderr,
"usage: cat [-beflnstuv] [-] [file ...]\n");
exit(EXIT_FAILURE);
/* NOTREACHED */
"Usage: %s [-beflnstuv] [-B bsize] [-] "
"[file ...]\n", getprogname());
return EXIT_FAILURE;
}
argv += optind;

Expand All @@ -133,7 +136,7 @@ main(int argc, char *argv[])
raw_args(argv);
if (fclose(stdout))
err(EXIT_FAILURE, "stdout");
return (rval);
return rval;
}

void
Expand Down Expand Up @@ -286,7 +289,6 @@ raw_cat(int rfd)
{
static char *buf;
static char fb_buf[BUFSIZ];
static size_t bsize;

ssize_t nr, nw, off;
int wfd;
Expand All @@ -295,10 +297,15 @@ raw_cat(int rfd)
if (buf == NULL) {
struct stat sbuf;

if (fstat(wfd, &sbuf) == 0 && sbuf.st_blksize > 0 &&
(size_t)sbuf.st_blksize > sizeof(fb_buf)) {
bsize = sbuf.st_blksize;
if (bsize == 0) {
if (fstat(wfd, &sbuf) == 0 && sbuf.st_blksize > 0 &&
(size_t)sbuf.st_blksize > sizeof(fb_buf))
bsize = sbuf.st_blksize;
}
if (bsize > sizeof(fb_buf)) {
buf = malloc(bsize);
if (buf == NULL)
warnx("malloc, using %zu buffer", bsize);
}
if (buf == NULL) {
bsize = sizeof(fb_buf);
Expand Down
3 changes: 0 additions & 3 deletions bin/date/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ DPADD+= ${LIBUTIL}
LDADD+= -lutil
CPPFLAGS+=-I${.CURDIR}

TZDIR= /usr/share/zoneinfo
CPPFLAGS+= -DHAVE_ADJTIME=0 -DTZDIR=\"$(TZDIR)\"

COPTS.date.c = -Wno-format-nonliteral

.include <bsd.prog.mk>
12 changes: 7 additions & 5 deletions bin/date/date.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $NetBSD: date.1,v 1.41 2010/02/04 22:56:11 wiz Exp $
.\" $NetBSD: date.1,v 1.42 2012/04/06 11:36:56 wiz Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -84,7 +84,7 @@ The utility
.Xr timed 8
is used to synchronize the clocks on groups of machines.
By default, if
timed
.Xr timed 8
is running,
.Nm
will set the time on all of the machines in the local group.
Expand Down Expand Up @@ -153,7 +153,7 @@ The second of the minute, from 00 to 61.
.Pp
Everything but the minutes is optional.
.Pp
Time changes for Daylight Saving and Standard time and leap seconds
Time changes for Daylight Saving and Standard Time and leap seconds
and years are handled automatically.
.Sh ENVIRONMENT
The following environment variables affect the execution of
Expand Down Expand Up @@ -217,12 +217,13 @@ On these occasions,
prints:
.Ql Network time being set .
The message
.Ql Communication error with timed
.Ql Communication error with
.Xr timed 8
occurs when the communication
between
.Nm
and
timed
.Xr timed 8
fails.
.Sh SEE ALSO
.Xr adjtime 2 ,
Expand All @@ -231,6 +232,7 @@ fails.
.Xr parsedate 3 ,
.Xr strftime 3 ,
.Xr utmp 5 ,
.Xr environ 7 ,
.Xr timed 8
.Rs
.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD"
Expand Down
13 changes: 3 additions & 10 deletions bin/date/date.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ main(int argc, char *argv[])
nflag = 1;
break;
case 'd':
#ifndef __minix
#if !defined(__minix)
rflag = 1;
tval = parsedate(optarg, NULL, NULL);
if (tval == -1)
#endif
#endif /* !defined(__minix) */
badarg: errx(EXIT_FAILURE,
"Cannot parse `%s'", optarg);
break;
Expand Down Expand Up @@ -311,19 +311,12 @@ setthetime(const char *p)
/* set the time */
if (nflag || netsettime(new_time)) {
logwtmp("|", "date", "");
#if HAVE_ADJTIME
if (aflag) {
tv.tv_sec = new_time - tval;
tv.tv_usec = 0;
if (adjtime(&tv, NULL))
err(EXIT_FAILURE, "adjtime");
}
#else
if (aflag) {
err(EXIT_FAILURE, "no adjtime");
}
#endif
else {
} else {
tval = new_time;
tv.tv_sec = tval;
tv.tv_usec = 0;
Expand Down
6 changes: 3 additions & 3 deletions bin/ed/re.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: re.c,v 1.19 2005/02/17 16:29:26 xtraeme Exp $ */
/* $NetBSD: re.c,v 1.20 2013/06/28 15:04:35 joerg Exp $ */

/* re.c: This file contains the regular expression interface routines for
the ed line editor. */
Expand Down Expand Up @@ -33,7 +33,7 @@
#if 0
static char *rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp";
#else
__RCSID("$NetBSD: re.c,v 1.19 2005/02/17 16:29:26 xtraeme Exp $");
__RCSID("$NetBSD: re.c,v 1.20 2013/06/28 15:04:35 joerg Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -95,7 +95,7 @@ extract_pattern(int delimiter)
default:
break;
case '[':
if ((nd = parse_char_class(++nd)) == NULL) {
if ((nd = parse_char_class(nd + 1)) == NULL) {
sprintf(errmsg, "unbalanced brackets ([])");
return NULL;
}
Expand Down
Loading

0 comments on commit 84d9c62

Please sign in to comment.