svn commit: r293175 - in projects/clang380-import: bin/sh bin/sh/tests/builtins etc etc/mtree etc/ntp lib/libgssapi lib/libnv/tests lib/libstand libexec/rtld-elf libexec/rtld-elf/aarch64 libexec/rt...

Dimitry Andric dim at FreeBSD.org
Mon Jan 4 20:31:12 UTC 2016


Author: dim
Date: Mon Jan  4 20:31:09 2016
New Revision: 293175
URL: https://svnweb.freebsd.org/changeset/base/293175

Log:
  Merge ^/head r293036 through r293174.

Added:
  projects/clang380-import/etc/mtree/BSD.libsoft.dist
     - copied unchanged from r293174, head/etc/mtree/BSD.libsoft.dist
  projects/clang380-import/sys/arm64/arm64/ofw_machdep.c
     - copied unchanged from r293174, head/sys/arm64/arm64/ofw_machdep.c
Modified:
  projects/clang380-import/bin/sh/exec.c
  projects/clang380-import/bin/sh/mkbuiltins
  projects/clang380-import/bin/sh/tests/builtins/Makefile
  projects/clang380-import/etc/Makefile
  projects/clang380-import/etc/mtree/Makefile
  projects/clang380-import/etc/ntp/leap-seconds
  projects/clang380-import/etc/rc
  projects/clang380-import/lib/libgssapi/gss_release_oid_set.c
  projects/clang380-import/lib/libnv/tests/dnv_tests.cc
  projects/clang380-import/lib/libnv/tests/nv_array_tests.cc
  projects/clang380-import/lib/libstand/Makefile
  projects/clang380-import/libexec/rtld-elf/aarch64/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/amd64/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/arm/reloc.c
  projects/clang380-import/libexec/rtld-elf/arm/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/i386/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/mips/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/paths.h
  projects/clang380-import/libexec/rtld-elf/powerpc/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/powerpc64/rtld_machdep.h
  projects/clang380-import/libexec/rtld-elf/rtld.c
  projects/clang380-import/libexec/rtld-elf/sparc64/rtld_machdep.h
  projects/clang380-import/release/Makefile
  projects/clang380-import/release/doc/en_US.ISO8859-1/hardware/article.xml
  projects/clang380-import/share/mk/src.opts.mk
  projects/clang380-import/share/vt/keymaps/gr.101.acc.kbd
  projects/clang380-import/share/vt/keymaps/gr.elot.acc.kbd
  projects/clang380-import/share/vt/keymaps/hu.101.kbd
  projects/clang380-import/share/vt/keymaps/hu.102.kbd
  projects/clang380-import/share/vt/keymaps/lt.kbd
  projects/clang380-import/share/vt/keymaps/pt.acc.kbd
  projects/clang380-import/share/vt/keymaps/pt.kbd
  projects/clang380-import/share/vt/keymaps/ua.kbd
  projects/clang380-import/share/vt/keymaps/ua.shift.alt.kbd
  projects/clang380-import/sys/amd64/amd64/machdep.c
  projects/clang380-import/sys/arm/arm/machdep.c
  projects/clang380-import/sys/arm/arm/physmem.c
  projects/clang380-import/sys/arm/xscale/ixp425/avila_machdep.c
  projects/clang380-import/sys/arm64/arm64/machdep.c
  projects/clang380-import/sys/arm64/include/ofw_machdep.h
  projects/clang380-import/sys/boot/efi/loader/main.c
  projects/clang380-import/sys/boot/libstand32/Makefile
  projects/clang380-import/sys/boot/uboot/lib/copy.c
  projects/clang380-import/sys/conf/files.arm64
  projects/clang380-import/sys/dev/ath/ah_osdep.c
  projects/clang380-import/sys/dev/ath/ah_osdep.h
  projects/clang380-import/sys/dev/iwm/if_iwm.c
  projects/clang380-import/sys/dev/iwm/if_iwm_mac_ctxt.c
  projects/clang380-import/sys/dev/iwm/if_iwmvar.h
  projects/clang380-import/sys/dev/ixl/if_ixl.c
  projects/clang380-import/sys/dev/ofw/ofw_bus_subr.c
  projects/clang380-import/sys/dev/rt/if_rt.c
  projects/clang380-import/sys/dev/sec/sec.c
  projects/clang380-import/sys/dev/syscons/plasma/fp16.c
  projects/clang380-import/sys/dev/syscons/plasma/fp16.h
  projects/clang380-import/sys/dev/syscons/plasma/plasma_saver.c
  projects/clang380-import/sys/dev/tsec/if_tsec.c
  projects/clang380-import/sys/fs/devfs/devfs_vnops.c
  projects/clang380-import/sys/i386/i386/machdep.c
  projects/clang380-import/sys/kern/kern_environment.c
  projects/clang380-import/sys/kgssapi/gss_impl.c
  projects/clang380-import/sys/mips/beri/beri_machdep.c
  projects/clang380-import/sys/modules/Makefile
  projects/clang380-import/sys/net/route.c
  projects/clang380-import/sys/net/route.h
  projects/clang380-import/sys/net/rtsock.c
  projects/clang380-import/sys/net80211/ieee80211_scan_sw.c
  projects/clang380-import/sys/netgraph/netflow/netflow.c
  projects/clang380-import/sys/netinet/in.c
  projects/clang380-import/sys/netinet/in_fib.c
  projects/clang380-import/sys/netinet6/icmp6.c
  projects/clang380-import/sys/netinet6/in6.h
  projects/clang380-import/sys/netinet6/in6_pcb.c
  projects/clang380-import/sys/netinet6/in6_src.c
  projects/clang380-import/sys/netinet6/ip6_output.c
  projects/clang380-import/sys/netinet6/ip6_var.h
  projects/clang380-import/sys/netinet6/nd6.c
  projects/clang380-import/sys/netinet6/nd6_nbr.c
  projects/clang380-import/sys/netinet6/raw_ip6.c
  projects/clang380-import/sys/netinet6/udp6_usrreq.c
  projects/clang380-import/sys/powerpc/aim/aim_machdep.c
  projects/clang380-import/sys/powerpc/aim/locore64.S
  projects/clang380-import/sys/powerpc/aim/mp_cpudep.c
  projects/clang380-import/sys/powerpc/booke/booke_machdep.c
  projects/clang380-import/sys/powerpc/include/cpu.h
  projects/clang380-import/sys/powerpc/include/intr_machdep.h
  projects/clang380-import/sys/powerpc/mpc85xx/lbc.c
  projects/clang380-import/sys/powerpc/mpc85xx/pci_mpc85xx.c
  projects/clang380-import/sys/powerpc/powerpc/cpu.c
  projects/clang380-import/sys/powerpc/powerpc/intr_machdep.c
  projects/clang380-import/sys/powerpc/powerpc/machdep.c
  projects/clang380-import/sys/sparc64/include/ofw_machdep.h
  projects/clang380-import/sys/sparc64/sparc64/machdep.c
  projects/clang380-import/sys/x86/xen/pv.c
  projects/clang380-import/tools/regression/geom_mirror/conf.sh
  projects/clang380-import/tools/regression/geom_mirror/test-1.t
  projects/clang380-import/tools/regression/geom_mirror/test-2.t
  projects/clang380-import/tools/regression/geom_mirror/test-3.t
  projects/clang380-import/tools/regression/geom_mirror/test-4.t
  projects/clang380-import/tools/regression/geom_mirror/test-5.t
  projects/clang380-import/tools/regression/geom_mirror/test-6.t
  projects/clang380-import/tools/regression/geom_mirror/test-7.t
  projects/clang380-import/tools/regression/geom_subr.sh
  projects/clang380-import/usr.sbin/gssd/gssd.c
  projects/clang380-import/usr.sbin/kbdcontrol/kbdmap.5
Directory Properties:
  projects/clang380-import/   (props changed)
  projects/clang380-import/share/   (props changed)
  projects/clang380-import/sys/   (props changed)
  projects/clang380-import/sys/boot/   (props changed)
  projects/clang380-import/sys/conf/   (props changed)

Modified: projects/clang380-import/bin/sh/exec.c
==============================================================================
--- projects/clang380-import/bin/sh/exec.c	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/bin/sh/exec.c	Mon Jan  4 20:31:09 2016	(r293175)
@@ -439,12 +439,14 @@ success:
 int
 find_builtin(const char *name, int *special)
 {
-	const struct builtincmd *bp;
+	const unsigned char *bp;
+	size_t len;
 
-	for (bp = builtincmd ; bp->name ; bp++) {
-		if (*bp->name == *name && equal(bp->name, name)) {
-			*special = bp->special;
-			return bp->code;
+	len = strlen(name);
+	for (bp = builtincmd ; *bp ; bp += 2 + bp[0]) {
+		if (bp[0] == len && memcmp(bp + 2, name, len) == 0) {
+			*special = (bp[1] & BUILTIN_SPECIAL) != 0;
+			return bp[1] & ~BUILTIN_SPECIAL;
 		}
 	}
 	return -1;

Modified: projects/clang380-import/bin/sh/mkbuiltins
==============================================================================
--- projects/clang380-import/bin/sh/mkbuiltins	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/bin/sh/mkbuiltins	Mon Jan  4 20:31:09 2016	(r293175)
@@ -62,17 +62,16 @@ echo 'int (*const builtinfunc[])(int, ch
 awk '/^[^#]/ {	printf "\t%s,\n", $1}' $temp
 echo '};
 
-const struct builtincmd builtincmd[] = {'
+const unsigned char builtincmd[] = {'
 awk '{	for (i = 2 ; i <= NF ; i++) {
 		if ($i == "-s") {
 			spc = 1;
 		} else {
-			printf "\t{ \"%s\", %d, %d },\n",  $i, NR-1, spc
+			printf "\t\"\\%03o\\%03o%s\"\n", length($i), (spc ? 128 : 0) + NR-1, $i
 			spc = 0;
 		}
 	}}' $temp
-echo '	{ NULL, 0, 0 }
-};'
+echo '};'
 
 exec > builtins.h
 cat <<\!
@@ -85,14 +84,10 @@ cat <<\!
 tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ < $temp |
 	awk '{	printf "#define %s %d\n", $1, NR-1}'
 echo '
-struct builtincmd {
-      const char *name;
-      int code;
-      int special;
-};
+#define BUILTIN_SPECIAL 0x80
 
 extern int (*const builtinfunc[])(int, char **);
-extern const struct builtincmd builtincmd[];
+extern const unsigned char builtincmd[];
 '
 awk '{	printf "int %s(int, char **);\n", $1}' $temp
 rm -f $temp

Modified: projects/clang380-import/bin/sh/tests/builtins/Makefile
==============================================================================
--- projects/clang380-import/bin/sh/tests/builtins/Makefile	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/bin/sh/tests/builtins/Makefile	Mon Jan  4 20:31:09 2016	(r293175)
@@ -94,6 +94,7 @@ FILES+=		getopts5.0
 FILES+=		getopts6.0
 FILES+=		getopts7.0
 FILES+=		getopts8.0 getopts8.0.stdout
+FILES+=		getopts9.0 getopts9.0.stdout
 FILES+=		hash1.0 hash1.0.stdout
 FILES+=		hash2.0 hash2.0.stdout
 FILES+=		hash3.0 hash3.0.stdout

Modified: projects/clang380-import/etc/Makefile
==============================================================================
--- projects/clang380-import/etc/Makefile	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/etc/Makefile	Mon Jan  4 20:31:09 2016	(r293175)
@@ -154,6 +154,9 @@ MTREE=	BSD.debug.dist BSD.include.dist B
 .if ${MK_LIB32} != "no"
 MTREE+=	BSD.lib32.dist
 .endif
+.if ${MK_LIBSOFT} != "no"
+MTREE+=	BSD.libsoft.dist
+.endif
 .if ${MK_TESTS} != "no"
 MTREE+=	BSD.tests.dist
 .endif
@@ -354,6 +357,10 @@ MTREES+=	mtree/BSD.groff.dist		/usr
 MTREES+=	mtree/BSD.lib32.dist		/usr
 MTREES+=	mtree/BSD.lib32.dist		/usr/lib/debug/usr
 .endif
+.if ${MK_LIBSOFT} != "no"
+MTREES+=	mtree/BSD.libsoft.dist		/usr
+MTREES+=	mtree/BSD.libsoft.dist		/usr/lib/debug/usr
+.endif
 .if ${MK_TESTS} != "no"
 MTREES+=	mtree/BSD.tests.dist		${TESTSBASE}
 MTREES+=	mtree/BSD.tests.dist		/usr/lib/debug/${TESTSBASE}

Copied: projects/clang380-import/etc/mtree/BSD.libsoft.dist (from r293174, head/etc/mtree/BSD.libsoft.dist)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang380-import/etc/mtree/BSD.libsoft.dist	Mon Jan  4 20:31:09 2016	(r293175, copy of r293174, head/etc/mtree/BSD.libsoft.dist)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+#
+# Please see the file src/etc/mtree/README before making changes to this file.
+#
+
+/set type=dir uname=root gname=wheel mode=0755
+.
+    libsoft
+        dtrace
+        ..
+        i18n
+        ..
+    ..
+..

Modified: projects/clang380-import/etc/mtree/Makefile
==============================================================================
--- projects/clang380-import/etc/mtree/Makefile	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/etc/mtree/Makefile	Mon Jan  4 20:31:09 2016	(r293175)
@@ -6,6 +6,7 @@ FILES=	${_BSD.debug.dist} \
 	BSD.include.dist \
 	BSD.root.dist \
 	${_BSD.lib32.dist} \
+	${_BSD.libsoft.dist} \
 	${_BSD.sendmail.dist} \
 	${_BSD.tests.dist} \
 	BSD.usr.dist \
@@ -20,6 +21,9 @@ _BSD.groff.dist=	BSD.groff.dist
 .if ${MK_LIB32} != "no"
 _BSD.lib32.dist=	BSD.lib32.dist
 .endif
+.if ${MK_LIBSOFT} != "no"
+_BSD.libsoft.dist=	BSD.libsoft.dist
+.endif
 .if ${MK_SENDMAIL} != "no"
 _BSD.sendmail.dist=	BSD.sendmail.dist
 .endif

Modified: projects/clang380-import/etc/ntp/leap-seconds
==============================================================================
--- projects/clang380-import/etc/ntp/leap-seconds	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/etc/ntp/leap-seconds	Mon Jan  4 20:31:09 2016	(r293175)
@@ -1,119 +1,221 @@
 #
 # $FreeBSD$
 #
-#	ATOMIC TIME.
-#	The Coordinated Universal Time (UTC) is the reference time scale derived 
-#	from The "Temps Atomique International" (TAI) calculated by the Bureau 
-#	International des Poids et Mesures (BIPM) using a worldwide network of atomic 
-#	clocks. UTC differs from TAI by an integer number of seconds; it is the basis 
-#	of all activities in the world. 
-#
-#
-#	ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. 
-#	It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various 
-#	irregular fluctuations progressively detected in the rotation rate of the Earth lead 
-#	in 1972 to the replacement of UT1 by UTC as the reference time scale. 
-#
-#
-#	LEAP SECOND
-#	Atomic clocks are more stable than the rate of the earth rotatiob since the later 
-#	undergoes a full range of geophysical perturbations at various time scales (lunisolar 
-#	and core-mantle torques,atmospheric and oceanic effetcs, ...)
-#	Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller 
-#	than 0.9 second. So, when necessary a "leap second" is introduced in UTC.
-#	Since the adoption of this system in 1972 it has been necessary to add 26 seconds to UTC, 
-#	firstly due to the initial choice of the value of the second (1/86400 mean solar day of 
-#	the year 1820) and secondly to the general slowing down of the Earth's rotation. It is 
-#	theorically possible to have a negative leap second (a second removed from UTC), but so far, 
-#	all leap seconds have been positive (a second has been added to UTC). Based on what we know about the earth's rotation, 
-#	it is unlikely that we will ever have a negative leap second.
-#
-#
-#	HISTORY
-#	The first leap second was added on June 30, 1972. Until 2000, it was necessary in average to add a leap second at a rate 
-#	of 1 to 2 years. Since 2000, due to the fact that the earth rate of rotation is accelerating, leap seconds are introduced 
-#	with an average  frequency of 3 to 4 years.
-#
-#
-#	RESPONSABILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC
-#	The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of 
-#	the International Earth Rotation and reference System Service (IERS). This center is located at Paris 
-#	Observatory. According to international agreements, leap second date have to occur at fixed date :
-#	first preference is given to the end of December and June, and second preference at the end of March 
-#	and September. Since the system was introduced in 1972, only dates in June and December were used.
-#
-#		Questions or comments to:
-#			Daniel Gambis, daniel.gambis at obspm.fr
-#			Christian Bizouard:  christian.bizouard at obspm.fr
-#			Earth orientation Center of the IERS
-#			Paris Observatory, France	
-#			
-#
-#
-#	VALIDITY OF THE FILE
-#	It is important to express the validity of the file. These next two dates are
-#	given in units of seconds since 1900.0.
-#
-#	1) Last update of the file. 
-#
-#	Updated through IERS Bulletin C (ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
-#
-#	The following line shows the last update of this file in NTP timestamp: 
-#
-#$	3645216000 
-#	 
-#	2) Expiration date of the file given on a semi-annual basis: last June or last December
-#
-#	File expires on 28 December 2015
-#
-#	Expire date in NTP timestamp: 
-#
-#@	3660249600
-#
-#
-#	LIST OF LEAP SECONDS
-#	NTP timestamp (X parameter) is the number of seconds since 1900.0
-#
-#	MJD: The Modified Julian Day number. MJD = X/86400 + 15020
-#
-#	DTAI: The difference DTAI= TAI-UTC in units of seconds
-#	It is the quantity to add to UTC to get the time in TAI
-#
-#	Day Month Year : epoch in clear
-#
-#NTP Time      DTAI    Day Month Year
-#
-2272060800      10      # 1 Jan 1972
-2287785600      11      # 1 Jul 1972
-2303683200      12      # 1 Jan 1973
-2335219200      13      # 1 Jan 1974
-2366755200      14      # 1 Jan 1975
-2398291200      15      # 1 Jan 1976
-2429913600      16      # 1 Jan 1977
-2461449600      17      # 1 Jan 1978
-2492985600      18      # 1 Jan 1979
-2524521600      19      # 1 Jan 1980
-2571782400      20      # 1 Jul 1981
-2603318400      21      # 1 Jul 1982
-2634854400      22      # 1 Jul 1983
-2698012800      23      # 1 Jul 1985
-2776982400      24      # 1 Jan 1988
-2840140800      25      # 1 Jan 1990
-2871676800      26      # 1 Jan 1991
-2918937600      27      # 1 Jul 1992
-2950473600      28      # 1 Jul 1993
-2982009600      29      # 1 Jul 1994
-3029443200      30      # 1 Jan 1996
-3076704000      31      # 1 Jul 1997
-3124137600      32      # 1 Jan 1999
-3345062400      33      # 1 Jan 2006
-3439756800      34      # 1 Jan 2009
-3550089600      35      # 1 Jul 2012
-3644697600      36      # 1 Jul 2015
-#
-#	In order to verify the integrity of this file, a hash code 
-#	has been generated. For more information how to use
-#	this hash code, please consult the README file under the 
-#	'sha' repertory.
+#	In the following text, the symbol '#' introduces
+#	a comment, which continues from that symbol until 
+#	the end of the line. A plain comment line has a
+#	whitespace character following the comment indicator.
+#	There are also special comment lines defined below. 
+#	A special comment will always have a non-whitespace 
+#	character in column 2.
+#
+#	A blank line should be ignored.
+#
+#	The following table shows the corrections that must
+#	be applied to compute International Atomic Time (TAI)
+#	from the Coordinated Universal Time (UTC) values that
+#	are transmitted by almost all time services.
+#
+#	The first column shows an epoch as a number of seconds
+#	since 1900.0 and the second column shows the number of
+#	seconds that must be added to UTC to compute TAI for
+#	any timestamp at or after that epoch. The value on 
+#	each line is valid from the indicated initial instant
+#	until the epoch given on the next one or indefinitely 
+#	into the future if there is no next line.
+#	(The comment on each line shows the representation of
+#	the corresponding initial epoch in the usual 
+#	day-month-year format. The epoch always begins at
+#	00:00:00 UTC on the indicated day. See Note 5 below.)
+#	
+#	Important notes:
+#
+#	1. Coordinated Universal Time (UTC) is often referred to
+#	as Greenwich Mean Time (GMT). The GMT time scale is no
+#	longer used, and the use of GMT to designate UTC is
+#	discouraged.
+#
+#	2. The UTC time scale is realized by many national 
+#	laboratories and timing centers. Each laboratory
+#	identifies its realization with its name: Thus
+#	UTC(NIST), UTC(USNO), etc. The differences among
+#	these different realizations are typically on the
+#	order of a few nanoseconds (i.e., 0.000 000 00x s)
+#	and can be ignored for many purposes. These differences
+#	are tabulated in Circular T, which is published monthly
+#	by the International Bureau of Weights and Measures
+#	(BIPM). See www.bipm.fr for more information.
+#
+#	3. The current defintion of the relationship between UTC 
+#	and TAI dates from 1 January 1972. A number of different 
+#	time scales were in use before than epoch, and it can be 
+#	quite difficult to compute precise timestamps and time 
+#	intervals in those "prehistoric" days. For more information,
+#	consult:
+#
+#		The Explanatory Supplement to the Astronomical
+#		Ephemeris.
+#	or
+#		Terry Quinn, "The BIPM and the Accurate Measurement
+#		of Time," Proc. of the IEEE, Vol. 79, pp. 894-905,
+#		July, 1991.
+#
+#	4.  The insertion of leap seconds into UTC is currently the
+#	responsibility of the International Earth Rotation Service,
+#	which is located at the Paris Observatory: 
+#
+#	Central Bureau of IERS
+#	61, Avenue de l'Observatoire
+#	75014 Paris, France.
+#
+#	Leap seconds are announced by the IERS in its Bulletin C
+#
+#	See hpiers.obspm.fr or www.iers.org for more details.
+#
+#	All national laboratories and timing centers use the
+#	data from the BIPM and the IERS to construct their
+#	local realizations of UTC.
+#
+#	Although the definition also includes the possibility
+#	of dropping seconds ("negative" leap seconds), this has 
+#	never been done and is unlikely to be necessary in the 
+#	foreseeable future.
+#
+#	5. If your system keeps time as the number of seconds since
+#	some epoch (e.g., NTP timestamps), then the algorithm for
+#	assigning a UTC time stamp to an event that happens during a positive
+#	leap second is not well defined. The official name of that leap 
+#	second is 23:59:60, but there is no way of representing that time 
+#	in these systems. 
+#	Many systems of this type effectively stop the system clock for 
+#	one second during the leap second and use a time that is equivalent 
+#	to 23:59:59 UTC twice. For these systems, the corresponding TAI 
+#	timestamp would be obtained by advancing to the next entry in the
+#	following table when the time equivalent to 23:59:59 UTC
+#	is used for the second time. Thus the leap second which
+#	occurred on 30 June 1972 at 23:59:59 UTC would have TAI
+#	timestamps computed as follows:
+#
+#	...
+#	30 June 1972 23:59:59 (2287785599, first time):	TAI= UTC + 10 seconds
+#	30 June 1972 23:59:60 (2287785599,second time):	TAI= UTC + 11 seconds
+#	1  July 1972 00:00:00 (2287785600)		TAI= UTC + 11 seconds
+#	...
+#
+#	If your system realizes the leap second by repeating 00:00:00 UTC twice
+#	(this is possible but not usual), then the advance to the next entry
+#	in the table must occur the second time that a time equivlent to 
+#	00:00:00 UTC is used. Thus, using the same example as above:
+#
+#	...
+#       30 June 1972 23:59:59 (2287785599):		TAI= UTC + 10 seconds
+#       30 June 1972 23:59:60 (2287785600, first time):	TAI= UTC + 10 seconds
+#       1  July 1972 00:00:00 (2287785600,second time):	TAI= UTC + 11 seconds
+#	...
+#
+#	in both cases the use of timestamps based on TAI produces a smooth
+#	time scale with no discontinuity in the time interval.
+#
+#	This complexity would not be needed for negative leap seconds (if they 
+#	are ever used). The UTC time would skip 23:59:59 and advance from 
+#	23:59:58 to 00:00:00 in that case.  The TAI offset would decrease by 
+#	1 second at the same instant.  This is a much easier situation to deal 
+#	with, since the difficulty of unambiguously representing the epoch 
+#	during the leap second does not arise.
+#
+#	Questions or comments to:
+#		Jeff Prillaman
+#		Time Service Department
+#		US Naval Observatory
+#		Washington, DC
+#		jeffrey.prillaman at usno.navy.mil
+#
+#	Last Update of leap second values:  31 Dec 2015
+#
+#	The following line shows this last update date in NTP timestamp 
+#	format. This is the date on which the most recent change to
+#	the leap second data was added to the file. This line can
+#	be identified by the unique pair of characters in the first two 
+#	columns as shown below.
+#
+#$	 3660508800
+#
+#	The data in this file will be updated periodically as new leap 
+#	seconds are announced. In addition to being entered on the line
+#	above, the update time (in NTP format) will be added to the basic 
+#	file name leap-seconds to form the name leap-seconds.<NTP TIME>.
+#	In addition, the generic name leap-seconds.list will always point to 
+#	the most recent version of the file.
+#
+#	This update procedure will be performed only when a new leap second
+#	is announced. 
+#
+#	The following entry specifies the expiration date of the data
+#	in this file in units of seconds since 1900.0.  This expiration date 
+#	will be changed at least twice per year whether or not a new leap 
+#	second is announced. These semi-annual changes will be made no
+#	later than 1 June and 1 December of each year to indicate what
+#	action (if any) is to be taken on 30 June and 31 December, 
+#	respectively. (These are the customary effective dates for new
+#	leap seconds.) This expiration date will be identified by a
+#	unique pair of characters in columns 1 and 2 as shown below.
+#	In the unlikely event that a leap second is announced with an 
+#	effective date other than 30 June or 31 December, then this
+#	file will be edited to include that leap second as soon as it is
+#	announced or at least one month before the effective date
+#	(whichever is later). 
+#	If an announcement by the IERS specifies that no leap second is 
+#	scheduled, then only the expiration date of the file will 
+#	be advanced to show that the information in the file is still
+#	current -- the update time stamp, the data and the name of the file 
+#	will not change.
+#
+#	Updated through IERS Bulletin C 50
+#	File expires on:  1 Jun 2016
+#
+#@	3673728000
+#
+2272060800	10	# 1 Jan 1972
+2287785600	11	# 1 Jul 1972
+2303683200	12	# 1 Jan 1973
+2335219200	13	# 1 Jan 1974
+2366755200	14	# 1 Jan 1975
+2398291200	15	# 1 Jan 1976
+2429913600	16	# 1 Jan 1977
+2461449600	17	# 1 Jan 1978
+2492985600	18	# 1 Jan 1979
+2524521600	19	# 1 Jan 1980
+2571782400	20	# 1 Jul 1981
+2603318400	21	# 1 Jul 1982
+2634854400	22	# 1 Jul 1983
+2698012800	23	# 1 Jul 1985
+2776982400	24	# 1 Jan 1988
+2840140800	25	# 1 Jan 1990
+2871676800	26	# 1 Jan 1991
+2918937600	27	# 1 Jul 1992
+2950473600	28	# 1 Jul 1993
+2982009600	29	# 1 Jul 1994
+3029443200	30	# 1 Jan 1996
+3076704000	31	# 1 Jul 1997
+3124137600	32	# 1 Jan 1999
+3345062400	33	# 1 Jan 2006
+3439756800	34	# 1 Jan 2009
+3550089600	35	# 1 Jul 2012
+3644697600	36	# 1 Jul 2015
+#
+#	the following special comment contains the
+#	hash value of the data in this file computed
+#	use the secure hash algorithm as specified
+#	by FIPS 180-1. See the files in ~/sha for
+#	the details of how this hash value is
+#	computed. Note that the hash computation
+#	ignores comments and whitespace characters
+#	in data lines. It includes the NTP values
+#	of both the last modification time and the 
+#	expiration time of the file, but not the
+#	white space on those lines.
+#	the hash line is also ignored in the
+#	computation.
+#
+#h	44a44c49 35b22601 a9c7054c 8c56cf57 9b6f6ed5
 #
-#h	620ba8af 37900668 95ac09ba d77640f9 6fd75493

Modified: projects/clang380-import/etc/rc
==============================================================================
--- projects/clang380-import/etc/rc	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/etc/rc	Mon Jan  4 20:31:09 2016	(r293175)
@@ -131,11 +131,14 @@ done
 
 # Remove the firstboot sentinel, and reboot if it was requested.
 if [ -e ${firstboot_sentinel} ]; then
-	rm ${firstboot_sentinel}
+	[ ${root_rw_mount} = "yes" ] || mount -uw /
+	/bin/rm ${firstboot_sentinel}
 	if [ -e ${firstboot_sentinel}-reboot ]; then
-		rm ${firstboot_sentinel}-reboot
+		/bin/rm ${firstboot_sentinel}-reboot
+		[ ${root_rw_mount} = "yes" ] || mount -ur /
 		kill -INT 1
 	fi
+	[ ${root_rw_mount} = "yes" ] || mount -ur /
 fi
 
 echo ''

Modified: projects/clang380-import/lib/libgssapi/gss_release_oid_set.c
==============================================================================
--- projects/clang380-import/lib/libgssapi/gss_release_oid_set.c	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/lib/libgssapi/gss_release_oid_set.c	Mon Jan  4 20:31:09 2016	(r293175)
@@ -32,15 +32,25 @@
 
 OM_uint32
 gss_release_oid_set(OM_uint32 *minor_status,
-    gss_OID_set *set)
+    gss_OID_set *setp)
 {
+	gss_OID_set set;
+	gss_OID o;
+	size_t i;
 
 	*minor_status = 0;
-	if (set && *set) {
-		if ((*set)->elements)
-			free((*set)->elements);
-		free(*set);
-		*set = GSS_C_NO_OID_SET;
+	if (setp) {
+		set = *setp;
+		if (set) {
+			for (i = 0; i < set->count; i++) {
+				o = &set->elements[i];
+				if (o->elements)
+					free(o->elements);
+			}
+			free(set->elements);
+			free(set);
+			*setp = GSS_C_NO_OID_SET;
+		}
 	}
 	return (GSS_S_COMPLETE);
 }

Modified: projects/clang380-import/lib/libnv/tests/dnv_tests.cc
==============================================================================
--- projects/clang380-import/lib/libnv/tests/dnv_tests.cc	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/lib/libnv/tests/dnv_tests.cc	Mon Jan  4 20:31:09 2016	(r293175)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/dnv.h>
 #include <sys/nv.h>
 

Modified: projects/clang380-import/lib/libnv/tests/nv_array_tests.cc
==============================================================================
--- projects/clang380-import/lib/libnv/tests/nv_array_tests.cc	Mon Jan  4 20:05:40 2016	(r293174)
+++ projects/clang380-import/lib/libnv/tests/nv_array_tests.cc	Mon Jan  4 20:31:09 2016	(r293175)
@@ -27,8 +27,9 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <sys/nv.h>
+#include <sys/param.h>
 #include <sys/types.h>
+#include <sys/nv.h>
 #include <sys/socket.h>
 
 #include <atf-c++.hpp>
@@ -50,7 +51,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba
 	const bool *const_result;
 	bool *result;
 	nvlist_t *nvl;
-	size_t nitems;
+	size_t num_items;
 	unsigned int i;
 	const char *key;
 
@@ -69,16 +70,16 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba
 	ATF_REQUIRE(nvlist_exists_bool_array(nvl, key));
 	ATF_REQUIRE(nvlist_exists_bool_array(nvl, "nvl/bool"));
 
-	const_result = nvlist_get_bool_array(nvl, key, &nitems);
-	ATF_REQUIRE_EQ(nitems, 16);
+	const_result = nvlist_get_bool_array(nvl, key, &num_items);
+	ATF_REQUIRE_EQ(num_items, 16);
 	ATF_REQUIRE(const_result != NULL);
-	for (i = 0; i < nitems; i++)
+	for (i = 0; i < num_items; i++)
 		ATF_REQUIRE_EQ(const_result[i], testbool[i]);
 
-	result = nvlist_take_bool_array(nvl, key, &nitems);
-	ATF_REQUIRE_EQ(nitems, 16);
+	result = nvlist_take_bool_array(nvl, key, &num_items);
+	ATF_REQUIRE_EQ(num_items, 16);
 	ATF_REQUIRE(const_result != NULL);
-	for (i = 0; i < nitems; i++)
+	for (i = 0; i < num_items; i++)
 		ATF_REQUIRE_EQ(result[i], testbool[i]);
 
 	ATF_REQUIRE(!nvlist_exists_bool_array(nvl, key));
@@ -95,10 +96,10 @@ ATF_TEST_CASE_BODY(nvlist_string_array__
 	const char * const *const_result;
 	char **result;
 	nvlist_t *nvl;
-	size_t nitems;
+	size_t num_items;
 	unsigned int i;
 	const char *key;
-	const char *string[8] = { "a", "b", "kot", "foo",
+	const char *string_arr[8] = { "a", "b", "kot", "foo",
 	    "tests", "nice test", "", "abcdef" };
 
 	key = "nvl/string";
@@ -107,32 +108,33 @@ ATF_TEST_CASE_BODY(nvlist_string_array__
 	ATF_REQUIRE(nvlist_empty(nvl));
 	ATF_REQUIRE(!nvlist_exists_string_array(nvl, key));
 
-	nvlist_add_string_array(nvl, key, string, 8);
+	nvlist_add_string_array(nvl, key, string_arr, nitems(string_arr));
 	ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_string_array(nvl, key));
 	ATF_REQUIRE(nvlist_exists_string_array(nvl, "nvl/string"));
 
-	const_result = nvlist_get_string_array(nvl, key, &nitems);
+	const_result = nvlist_get_string_array(nvl, key, &num_items);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(const_result != NULL);
-	ATF_REQUIRE(nitems == 8);
-	for (i = 0; i < nitems; i++) {
-		if (string[i] != NULL) {
-			ATF_REQUIRE(strcmp(const_result[i], string[i]) == 0);
+	ATF_REQUIRE(num_items == nitems(string_arr));
+	for (i = 0; i < num_items; i++) {
+		if (string_arr[i] != NULL) {
+			ATF_REQUIRE(strcmp(const_result[i],
+			    string_arr[i]) == 0);
 		} else {
-			ATF_REQUIRE(const_result[i] == string[i]);
+			ATF_REQUIRE(const_result[i] == string_arr[i]);
 		}
 	}
 
-	result = nvlist_take_string_array(nvl, key, &nitems);
+	result = nvlist_take_string_array(nvl, key, &num_items);
 	ATF_REQUIRE(result != NULL);
-	ATF_REQUIRE_EQ(nitems, 8);
-	for (i = 0; i < nitems; i++) {
-		if (string[i] != NULL) {
-			ATF_REQUIRE_EQ(strcmp(result[i], string[i]), 0);
+	ATF_REQUIRE_EQ(num_items, nitems(string_arr));
+	for (i = 0; i < num_items; i++) {
+		if (string_arr[i] != NULL) {
+			ATF_REQUIRE_EQ(strcmp(result[i], string_arr[i]), 0);
 		} else {
-			ATF_REQUIRE_EQ(result[i], string[i]);
+			ATF_REQUIRE_EQ(result[i], string_arr[i]);
 		}
 	}
 
@@ -140,7 +142,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__
 	ATF_REQUIRE(nvlist_empty(nvl));
 	ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
 
-	for (i = 0; i < 8; i++)
+	for (i = 0; i < num_items; i++)
 		free(result[i]);
 	free(result);
 	nvlist_destroy(nvl);
@@ -152,11 +154,11 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr
 	int fd[32], *result;
 	const int *const_result;
 	nvlist_t *nvl;
-	size_t nitems;
+	size_t num_items;
 	unsigned int i;
 	const char *key;
 
-	for (i = 0; i < 32; i++) {
+	for (i = 0; i < nitems(fd); i++) {
 		fd[i] = dup(STDERR_FILENO);
 		ATF_REQUIRE(fd_is_valid(fd[i]));
 	}
@@ -167,26 +169,26 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr
 	ATF_REQUIRE(nvlist_empty(nvl));
 	ATF_REQUIRE(!nvlist_exists_descriptor_array(nvl, key));
 
-	nvlist_add_descriptor_array(nvl, key, fd, 32);
+	nvlist_add_descriptor_array(nvl, key, fd, nitems(fd));
 	ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key));
 	ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, "nvl/descriptor"));
 
-	const_result = nvlist_get_descriptor_array(nvl, key, &nitems);
+	const_result = nvlist_get_descriptor_array(nvl, key, &num_items);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(const_result != NULL);
-	ATF_REQUIRE(nitems == 32);
-	for (i = 0; i < nitems; i++) {
+	ATF_REQUIRE(num_items == nitems(fd));
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE(fd_is_valid(const_result[i]));
 		if (i > 0)
 			ATF_REQUIRE(const_result[i] != const_result[i - 1]);
 	}
 
-	result = nvlist_take_descriptor_array(nvl, key, &nitems);
+	result = nvlist_take_descriptor_array(nvl, key, &num_items);
 	ATF_REQUIRE(result != NULL);
-	ATF_REQUIRE_EQ(nitems, 32);
-	for (i = 0; i < nitems; i++) {
+	ATF_REQUIRE_EQ(num_items, nitems(fd));
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE(fd_is_valid(result[i]));
 		if (i > 0)
 			ATF_REQUIRE(const_result[i] != const_result[i - 1]);
@@ -196,7 +198,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr
 	ATF_REQUIRE(nvlist_empty(nvl));
 	ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
 
-	for (i = 0; i < nitems; i++) {
+	for (i = 0; i < num_items; i++) {
 		close(result[i]);
 		close(fd[i]);
 	}
@@ -210,7 +212,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__
 	const uint64_t *const_result;
 	uint64_t *result;
 	nvlist_t *nvl;
-	size_t nitems;
+	size_t num_items;
 	unsigned int i;
 	const char *key;
 	const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90,
@@ -222,23 +224,23 @@ ATF_TEST_CASE_BODY(nvlist_number_array__
 	ATF_REQUIRE(nvlist_empty(nvl));
 	ATF_REQUIRE(!nvlist_exists_string_array(nvl, key));
 
-	nvlist_add_number_array(nvl, key, number, 8);
+	nvlist_add_number_array(nvl, key, number, nitems(number));
 	ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_number_array(nvl, key));
 	ATF_REQUIRE(nvlist_exists_number_array(nvl, "nvl/number"));
 
-	const_result = nvlist_get_number_array(nvl, key, &nitems);
+	const_result = nvlist_get_number_array(nvl, key, &num_items);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(const_result != NULL);
-	ATF_REQUIRE(nitems == 8);
-	for (i = 0; i < nitems; i++)
+	ATF_REQUIRE(num_items == nitems(number));
+	for (i = 0; i < num_items; i++)
 		ATF_REQUIRE_EQ(const_result[i], number[i]);
 
-	result = nvlist_take_number_array(nvl, key, &nitems);
+	result = nvlist_take_number_array(nvl, key, &num_items);
 	ATF_REQUIRE(result != NULL);
-	ATF_REQUIRE_EQ(nitems, 8);
-	for (i = 0; i < nitems; i++)
+	ATF_REQUIRE_EQ(num_items, nitems(number));
+	for (i = 0; i < num_items; i++)
 		ATF_REQUIRE_EQ(result[i], number[i]);
 
 	ATF_REQUIRE(!nvlist_exists_string_array(nvl, key));
@@ -256,7 +258,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__
 	const nvlist_t * const *const_result;
 	nvlist_t **result;
 	nvlist_t *nvl;
-	size_t nitems;
+	size_t num_items;
 	unsigned int i;
 	const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" };
 	const char *key;
@@ -282,14 +284,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__
 	ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key));
 	ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, "nvl/nvlist"));
 
-	const_result = nvlist_get_nvlist_array(nvl, key, &nitems);
+	const_result = nvlist_get_nvlist_array(nvl, key, &num_items);
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(const_result != NULL);
-	ATF_REQUIRE(nitems == 8);
+	ATF_REQUIRE(num_items == nitems(testnvl));
 
-	for (i = 0; i < nitems; i++) {
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0);
-		if (i < nitems - 1) {
+		if (i < num_items - 1) {
 			ATF_REQUIRE(nvlist_get_array_next(const_result[i]) ==
 			    const_result[i + 1]);
 		} else {
@@ -304,10 +306,10 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__
 		    "nvl/string"), somestr[i]) == 0);
 	}
 
-	result = nvlist_take_nvlist_array(nvl, key, &nitems);
+	result = nvlist_take_nvlist_array(nvl, key, &num_items);
 	ATF_REQUIRE(result != NULL);
-	ATF_REQUIRE_EQ(nitems, 8);
-	for (i = 0; i < nitems; i++) {
+	ATF_REQUIRE_EQ(num_items, 8);
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE_EQ(nvlist_error(result[i]), 0);
 		ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL);
 		ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == NULL);
@@ -335,19 +337,19 @@ ATF_TEST_CASE_BODY(nvlist_clone_array)
 	const nvlist_t *nvl;
 	bool testbool[16];
 	int testfd[16];
-	size_t i, nitems;
-	const char *string[8] = { "a", "b", "kot", "foo",
+	size_t i, num_items;
+	const char *string_arr[8] = { "a", "b", "kot", "foo",
 	    "tests", "nice test", "", "abcdef" };
 	const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" };
 	const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90,
 	    100000, 8, 1 };
 
-	for (i = 0; i < 16; i++) {
+	for (i = 0; i < nitems(testfd); i++) {
 		testbool[i] = (i % 2 == 0);
 		testfd[i] = dup(STDERR_FILENO);
 		ATF_REQUIRE(fd_is_valid(testfd[i]));
 	}
-	for (i = 0; i < 8; i++) {
+	for (i = 0; i < nitems(testnvl); i++) {
 		testnvl[i] = nvlist_create(0);
 		ATF_REQUIRE(nvlist_error(testnvl[i]) == 0);
 		nvlist_add_string(testnvl[i], "nvl/nvl/teststr", somestr[i]);
@@ -358,28 +360,30 @@ ATF_TEST_CASE_BODY(nvlist_clone_array)
 	ATF_REQUIRE(nvlist_error(src) == 0);
 
 	ATF_REQUIRE(!nvlist_exists_bool_array(src, "nvl/bool"));
-	nvlist_add_bool_array(src, "nvl/bool", testbool, 16);
+	nvlist_add_bool_array(src, "nvl/bool", testbool, nitems(testbool));
 	ATF_REQUIRE_EQ(nvlist_error(src), 0);
 	ATF_REQUIRE(nvlist_exists_bool_array(src, "nvl/bool"));
 
 	ATF_REQUIRE(!nvlist_exists_string_array(src, "nvl/string"));
-	nvlist_add_string_array(src, "nvl/string", string, 8);
+	nvlist_add_string_array(src, "nvl/string", string_arr,
+	    nitems(string_arr));
 	ATF_REQUIRE_EQ(nvlist_error(src), 0);
 	ATF_REQUIRE(nvlist_exists_string_array(src, "nvl/string"));
 
 	ATF_REQUIRE(!nvlist_exists_descriptor_array(src, "nvl/fd"));
-	nvlist_add_descriptor_array(src, "nvl/fd", testfd, 16);
+	nvlist_add_descriptor_array(src, "nvl/fd", testfd, nitems(testfd));
 	ATF_REQUIRE_EQ(nvlist_error(src), 0);
 	ATF_REQUIRE(nvlist_exists_descriptor_array(src, "nvl/fd"));
 
 	ATF_REQUIRE(!nvlist_exists_number_array(src, "nvl/number"));
-	nvlist_add_number_array(src, "nvl/number", number, 8);
+	nvlist_add_number_array(src, "nvl/number", number,
+	    nitems(number));
 	ATF_REQUIRE_EQ(nvlist_error(src), 0);
 	ATF_REQUIRE(nvlist_exists_number_array(src, "nvl/number"));
 
 	ATF_REQUIRE(!nvlist_exists_nvlist_array(src, "nvl/array"));
 	nvlist_add_nvlist_array(src, "nvl/array",
-	    (const nvlist_t * const *)testnvl, 8);
+	    (const nvlist_t * const *)testnvl, nitems(testnvl));
 	ATF_REQUIRE_EQ(nvlist_error(src), 0);
 	ATF_REQUIRE(nvlist_exists_nvlist_array(src, "nvl/array"));
 
@@ -387,62 +391,62 @@ ATF_TEST_CASE_BODY(nvlist_clone_array)
 	ATF_REQUIRE(dst != NULL);
 
 	ATF_REQUIRE(nvlist_exists_bool_array(dst, "nvl/bool"));
-	(void) nvlist_get_bool_array(dst, "nvl/bool", &nitems);
-	ATF_REQUIRE_EQ(nitems, 16);
-	for (i = 0; i < nitems; i++) {
+	(void) nvlist_get_bool_array(dst, "nvl/bool", &num_items);
+	ATF_REQUIRE_EQ(num_items, nitems(testbool));
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE(
-		    nvlist_get_bool_array(dst, "nvl/bool", &nitems)[i] ==
-		    nvlist_get_bool_array(src, "nvl/bool", &nitems)[i]);
+		    nvlist_get_bool_array(dst, "nvl/bool", &num_items)[i] ==
+		    nvlist_get_bool_array(src, "nvl/bool", &num_items)[i]);
 	}
 
 	ATF_REQUIRE(nvlist_exists_string_array(dst, "nvl/string"));
-	(void) nvlist_get_string_array(dst, "nvl/string", &nitems);
-	ATF_REQUIRE_EQ(nitems, 8);
-	for (i = 0; i < nitems; i++) {
+	(void) nvlist_get_string_array(dst, "nvl/string", &num_items);
+	ATF_REQUIRE_EQ(num_items, nitems(string_arr));
+	for (i = 0; i < num_items; i++) {
 		if (nvlist_get_string_array(dst, "nvl/string",
-		    &nitems)[i] == NULL) {
+		    &num_items)[i] == NULL) {
 			ATF_REQUIRE(nvlist_get_string_array(dst, "nvl/string",
-			    &nitems)[i] == nvlist_get_string_array(src,
-			    "nvl/string", &nitems)[i]);
+			    &num_items)[i] == nvlist_get_string_array(src,
+			    "nvl/string", &num_items)[i]);
 		} else {
 			ATF_REQUIRE(strcmp(nvlist_get_string_array(dst,
-			    "nvl/string", &nitems)[i], nvlist_get_string_array(
-			    src, "nvl/string", &nitems)[i]) == 0);
+			    "nvl/string", &num_items)[i], nvlist_get_string_array(
+			    src, "nvl/string", &num_items)[i]) == 0);
 		}
 	}
 
 	ATF_REQUIRE(nvlist_exists_descriptor_array(dst, "nvl/fd"));
-	(void) nvlist_get_descriptor_array(dst, "nvl/fd", &nitems);
-	ATF_REQUIRE_EQ(nitems, 16);
-	for (i = 0; i < nitems; i++) {
+	(void) nvlist_get_descriptor_array(dst, "nvl/fd", &num_items);
+	ATF_REQUIRE_EQ(num_items, nitems(testfd));
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE(fd_is_valid(
-		    nvlist_get_descriptor_array(dst, "nvl/fd", &nitems)[i]));
+		    nvlist_get_descriptor_array(dst, "nvl/fd", &num_items)[i]));
 	}
 	ATF_REQUIRE(nvlist_exists_number_array(dst, "nvl/number"));
-	(void) nvlist_get_number_array(dst, "nvl/number", &nitems);
-	ATF_REQUIRE_EQ(nitems, 8);
+	(void) nvlist_get_number_array(dst, "nvl/number", &num_items);
+	ATF_REQUIRE_EQ(num_items, nitems(number));
 
-	for (i = 0; i < nitems; i++) {
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE(
-		    nvlist_get_number_array(dst, "nvl/number", &nitems)[i] ==
-		    nvlist_get_number_array(src, "nvl/number", &nitems)[i]);
+		    nvlist_get_number_array(dst, "nvl/number", &num_items)[i] ==
+		    nvlist_get_number_array(src, "nvl/number", &num_items)[i]);
 	}
 
 	ATF_REQUIRE(nvlist_exists_nvlist_array(dst, "nvl/array"));
-	(void) nvlist_get_nvlist_array(dst, "nvl/array", &nitems);
-	ATF_REQUIRE_EQ(nitems, 8);
-	for (i = 0; i < nitems; i++) {
-		nvl = nvlist_get_nvlist_array(dst, "nvl/array", &nitems)[i];
+	(void) nvlist_get_nvlist_array(dst, "nvl/array", &num_items);
+	ATF_REQUIRE_EQ(num_items, nitems(testnvl));
+	for (i = 0; i < num_items; i++) {
+		nvl = nvlist_get_nvlist_array(dst, "nvl/array", &num_items)[i];
 		ATF_REQUIRE(nvlist_exists_string(nvl, "nvl/nvl/teststr"));
 		ATF_REQUIRE(strcmp(nvlist_get_string(nvl, "nvl/nvl/teststr"),
 		    somestr[i]) == 0);
 	}
 
-	for (i = 0; i < 16; i++) {
+	for (i = 0; i < nitems(testfd); i++) {
 		close(testfd[i]);
-		if (i < 8) {
-			nvlist_destroy(testnvl[i]);
-		}
+	}
+	for (i = 0; i < nitems(testnvl); i++) {
+		nvlist_destroy(testnvl[i]);
 	}
 	nvlist_destroy(src);
 	nvlist_destroy(dst);
@@ -454,7 +458,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo
 	bool *testbool;
 	const bool *const_result;
 	nvlist_t *nvl;
-	size_t nitems, count;
+	size_t num_items, count;
 	unsigned int i;
 	const char *key;
 
@@ -475,11 +479,11 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_bool_array(nvl, key));
 
-	const_result = nvlist_get_bool_array(nvl, key, &nitems);
-	ATF_REQUIRE_EQ(nitems, count);
+	const_result = nvlist_get_bool_array(nvl, key, &num_items);
+	ATF_REQUIRE_EQ(num_items, count);
 	ATF_REQUIRE(const_result != NULL);
 	ATF_REQUIRE(const_result == testbool);
-	for (i = 0; i < nitems; i++)
+	for (i = 0; i < num_items; i++)
 		ATF_REQUIRE_EQ(const_result[i], (i % 2 == 0));
 
 	nvlist_destroy(nvl);
@@ -491,7 +495,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__
 	char **teststr;
 	const char * const *const_result;
 	nvlist_t *nvl;
-	size_t nitems, count;
+	size_t num_items, count;
 	unsigned int i;
 	const char *key;
 
@@ -516,11 +520,11 @@ ATF_TEST_CASE_BODY(nvlist_string_array__
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_string_array(nvl, key));
 
-	const_result = nvlist_get_string_array(nvl, key, &nitems);
-	ATF_REQUIRE_EQ(nitems, count);
+	const_result = nvlist_get_string_array(nvl, key, &num_items);
+	ATF_REQUIRE_EQ(num_items, count);
 	ATF_REQUIRE(const_result != NULL);
 	ATF_REQUIRE((intptr_t)const_result == (intptr_t)teststr);
-	for (i = 0; i < nitems; i++) {
+	for (i = 0; i < num_items; i++) {
 		ATF_REQUIRE_EQ(const_result[i][0], (char)('a' + i));
 		ATF_REQUIRE_EQ(const_result[i][1], '\0');
 	}
@@ -534,7 +538,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__
 	nvlist **testnv;
 	const nvlist * const *const_result;
 	nvlist_t *nvl;
-	size_t nitems, count;
+	size_t num_items, count;
 	unsigned int i;
 	const char *key;
 
@@ -557,14 +561,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__
 	ATF_REQUIRE(!nvlist_empty(nvl));
 	ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key));

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list