CVS commit: src/lib/libc/time

2016-09-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 22 23:18:11 UTC 2016

Modified Files:
src/lib/libc/time: strftime.3

Log Message:
Since the argument buf is earlier described as a buffer, replace all
references to "the array" with "the buffer" for consistency.

Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/time/strftime.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/strftime.3
diff -u src/lib/libc/time/strftime.3:1.30 src/lib/libc/time/strftime.3:1.31
--- src/lib/libc/time/strftime.3:1.30	Fri Sep 20 19:06:54 2013
+++ src/lib/libc/time/strftime.3	Thu Sep 22 23:18:10 2016
@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)strftime.3	5.12 (Berkeley) 6/29/91
-.\"	$NetBSD: strftime.3,v 1.30 2013/09/20 19:06:54 christos Exp $
+.\"	$NetBSD: strftime.3,v 1.31 2016/09/22 23:18:10 pgoyette Exp $
 .\"
-.Dd April 14, 2011
+.Dd September 22, 2016
 .Dt STRFTIME 3
 .Os
 .Sh NAME
@@ -68,14 +68,14 @@ and one other character.
 .Pp
 No more than
 .Fa maxsize
-characters will be placed into the array.
+characters will be placed into the buffer.
 If the total number of resulting characters, including the terminating
 null character, is not more than
 .Fa maxsize ,
 .Fn strftime
-returns the number of characters in the array, not counting the
+returns the number of characters in the buffer, not counting the
 terminating null.
-Otherwise, zero is returned and the contents of the array are undefined.
+Otherwise, zero is returned and the contents of the buffer are undefined.
 .Pp
 Each conversion specification is replaced by the characters as
 follows which are then copied into the buffer.



CVS commit: src/sbin/ifconfig

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 18:22:52 UTC 2016

Modified Files:
src/sbin/ifconfig: ieee80211.c

Log Message:
fix bugs in ssid printing


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sbin/ifconfig/ieee80211.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/ieee80211.c
diff -u src/sbin/ifconfig/ieee80211.c:1.28 src/sbin/ifconfig/ieee80211.c:1.29
--- src/sbin/ifconfig/ieee80211.c:1.28	Tue Apr 28 11:14:57 2015
+++ src/sbin/ifconfig/ieee80211.c	Thu Sep 22 14:22:51 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211.c,v 1.28 2015/04/28 15:14:57 christos Exp $	*/
+/*	$NetBSD: ieee80211.c,v 1.29 2016/09/22 18:22:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ieee80211.c,v 1.28 2015/04/28 15:14:57 christos Exp $");
+__RCSID("$NetBSD: ieee80211.c,v 1.29 2016/09/22 18:22:51 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -765,14 +765,36 @@ scan_and_wait(prop_dictionary_t env)
 	prog_close(sroute);
 }
 
+static int
+calc_len(const u_int8_t *cp, int len)
+{
+	int maxlen = 0, curlen;
+	const struct ieee80211req_scan_result *sr;
+	char buf[IEEE80211_NWID_LEN];
+
+	while (len >= (int)sizeof(*sr)) {
+		sr = (const struct ieee80211req_scan_result *)cp;
+		cp += sr->isr_len;
+		len -= sr->isr_len;
+		curlen = copy_essid(buf, sizeof(buf),
+		(const u_int8_t *)(sr + 1), sr->isr_ssid_len);
+		if (curlen >= IEEE80211_NWID_LEN)
+			return IEEE80211_NWID_LEN;
+		if (curlen > maxlen)
+			maxlen = curlen;
+	}
+	return maxlen;
+}
+
 static void
 list_scan(prop_dictionary_t env)
 {
-	u_int8_t buf[24*1024];
+	u_int8_t buf[64*1024 - 1];
 	struct ieee80211req ireq;
 	char ssid[IEEE80211_NWID_LEN+1];
 	const u_int8_t *cp;
 	int len, ssidmax;
+	const struct ieee80211req_scan_result *sr;
 
 	memset(, 0, sizeof(ireq));
 	ireq.i_type = IEEE80211_IOC_SCAN_RESULTS;
@@ -781,10 +803,11 @@ list_scan(prop_dictionary_t env)
 	if (direct_ioctl(env, SIOCG80211, ) < 0)
 		errx(EXIT_FAILURE, "unable to get scan results");
 	len = ireq.i_len;
-	if (len < (int)sizeof(struct ieee80211req_scan_result))
+	if (len < (int)sizeof(*sr))
 		return;
 
-	ssidmax = IEEE80211_NWID_LEN;
+	ssidmax = calc_len(buf, len);
+
 	printf("%-*.*s  %-17.17s  %4s %4s  %-7s %3s %4s\n"
 		, ssidmax, ssidmax, "SSID"
 		, "BSSID"
@@ -795,16 +818,14 @@ list_scan(prop_dictionary_t env)
 		, "CAPS"
 	);
 	cp = buf;
-	do {
-		const struct ieee80211req_scan_result *sr;
+	while (len >= (int)sizeof(*sr)) {
 		const uint8_t *vp;
 
 		sr = (const struct ieee80211req_scan_result *) cp;
 		vp = (const u_int8_t *)(sr+1);
+		(void)copy_essid(ssid, sizeof(ssid), vp, sr->isr_ssid_len);
 		printf("%-*.*s  %s  %3d  %3dM %3d:%-3d  %3d %-4.4s"
-			, ssidmax
-			  , copy_essid(ssid, ssidmax, vp, sr->isr_ssid_len)
-			  , ssid
+			, ssidmax, ssidmax, ssid
 			, ether_ntoa((const struct ether_addr *) sr->isr_bssid)
 			, ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags)
 			, getmaxrate(sr->isr_rates, sr->isr_nrates)
@@ -815,7 +836,7 @@ list_scan(prop_dictionary_t env)
 		printies(vp + sr->isr_ssid_len, sr->isr_ie_len, 24);
 		printf("\n");
 		cp += sr->isr_len, len -= sr->isr_len;
-	} while (len >= (int)sizeof(struct ieee80211req_scan_result));
+	}
 }
 /*
  * Convert MHz frequency to IEEE channel number.
@@ -1144,18 +1165,22 @@ static int
 copy_essid(char buf[], size_t bufsize, const u_int8_t *essid, size_t essid_len)
 {
 	const u_int8_t *p;
+	int printable;
 	size_t maxlen, i;
 
-	if (essid_len > bufsize)
+	if (essid_len + 1 > bufsize)
 		maxlen = bufsize;
 	else
-		maxlen = essid_len;
+		maxlen = essid_len + 1;
 	/* determine printable or not */
-	for (i = 0, p = essid; i < maxlen; i++, p++) {
-		if (*p < ' ' || *p > 0x7e)
+	printable = 1;
+	for (i = 0, p = essid; i < essid_len; i++, p++) {
+		if (*p < ' ' || *p > 0x7e) {
+			printable = 0;
 			break;
+		}
 	}
-	if (i != maxlen) {		/* not printable, print as hex */
+	if (!printable) {		/* not printable, print as hex */
 		if (bufsize < 3)
 			return 0;
 		strlcpy(buf, "0x", bufsize);
@@ -1165,14 +1190,14 @@ copy_essid(char buf[], size_t bufsize, c
 			sprintf([2+2*i], "%02x", p[i]);
 			bufsize -= 2;
 		}
-		if (i != essid_len)
-			memcpy([2+2*i-3], "...", 3);
-	} else {			/* printable, truncate as needed */
-		memcpy(buf, essid, maxlen);
-		if (maxlen != essid_len)
-			memcpy([maxlen-3], "...", 3);
-	}
-	return maxlen;
+		maxlen = i;
+	} else{
+		/* printable, truncate as needed */
+		strlcpy(buf, (const char *)essid, maxlen);
+	}
+	if (maxlen != essid_len + 1)
+		memcpy([maxlen - 4], "...", 4);
+	return (int)strlen(buf);
 }
 
 static void



CVS commit: xsrc/external/mit/xf86-video-suncg6/dist/src

2016-09-22 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Thu Sep 22 17:14:59 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-suncg6/dist/src: cg6_accel.c

Log Message:
return something.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c
diff -u xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c:1.6 xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c:1.7
--- xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c:1.6	Fri Aug 19 21:28:34 2016
+++ xsrc/external/mit/xf86-video-suncg6/dist/src/cg6_accel.c	Thu Sep 22 13:14:59 2016
@@ -547,10 +547,12 @@ Cg6DGAInit(ScreenPtr pScreen)
 if (result) {
 	xf86Msg(X_INFO, "%s: DGA initialized\n",
 pCg6->psdp->device);
+	return TRUE;
 } else {
  	xf86Msg(X_WARNING, "%s: DGA setup failed\n",
 pCg6->psdp->device);
-}   
+	return FALSE;
+}
 }
 
 static Bool 



CVS commit: xsrc/external/mit/xf86-video-mga/dist/src

2016-09-22 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Thu Sep 22 17:11:58 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-mga/dist/src: mga_dacG.c

Log Message:
use fabs


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c
diff -u xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.3 xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.4
--- xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c:1.3	Fri Aug 19 20:27:21 2016
+++ xsrc/external/mit/xf86-video-mga/dist/src/mga_dacG.c	Thu Sep 22 13:11:58 2016
@@ -798,13 +798,15 @@ MGAGCalcClock ( ScrnInfoPtr pScrn, long 
 		/* see values of ( n ) which we can't use */
 		for ( n = feed_div_min; n <= feed_div_max; n++ )
 		{ 
+			double av;
 			calc_f = ref_freq * (n + 1) / (m + 1) ;
 
 			/*
 			 * Pick the closest frequency.
 			 */
-			if ( abs(calc_f - f_vco) < m_err ) {
-m_err = abs(calc_f - f_vco);
+			av = fabs(calc_f - f_vco);
+			if ( av < m_err ) {
+m_err = av;
 *best_m = m;
 *best_n = n;
 			}



CVS commit: src/sys/arch/atari/stand/binpatch

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 17:08:16 UTC 2016

Modified Files:
src/sys/arch/atari/stand/binpatch: binpatch.c

Log Message:
Catch up with mdsetimage changes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/binpatch/binpatch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/stand/binpatch/binpatch.c
diff -u src/sys/arch/atari/stand/binpatch/binpatch.c:1.6 src/sys/arch/atari/stand/binpatch/binpatch.c:1.7
--- src/sys/arch/atari/stand/binpatch/binpatch.c:1.6	Thu Aug 20 11:14:49 2009
+++ src/sys/arch/atari/stand/binpatch/binpatch.c	Thu Sep 22 13:08:16 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: binpatch.c,v 1.6 2009/08/20 15:14:49 tsutsui Exp $ */
+/* $NetBSD: binpatch.c,v 1.7 2016/09/22 17:08:16 christos Exp $ */
 
 /*-
  * Copyright (c) 2009 Izumi Tsutsui.  All rights reserved.
@@ -60,7 +60,7 @@ __COPYRIGHT("@(#) Copyright (c) 1996\
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: binpatch.c,v 1.6 2009/08/20 15:14:49 tsutsui Exp $");
+__RCSID("$NetBSD: binpatch.c,v 1.7 2016/09/22 17:08:16 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -79,7 +79,6 @@ __RCSID("$NetBSD: binpatch.c,v 1.6 2009/
 
 #include "extern.h"
 
-int		main(int, char *[]);
 static void	usage(void) __dead;
 
 bool replace, verbose;
@@ -88,20 +87,10 @@ char *symbol;
 size_t size;
 uint64_t val;
 	
-#ifdef NLIST_AOUT
-/*
- * Since we can't get the text address from an a.out executable, we
- * need to be able to specify it.  Note: there's no way to test to
- * see if the user entered a valid address!
- */
-int	T_flag_specified;	/* the -T flag was specified */
-u_long	text_start;		/* Start of kernel text */
-#endif /* NLIST_AOUT */
-
 static const struct {
 	const char *name;
 	int	(*check)(const char *, size_t);
-	int	(*findoff)(const char *, size_t, u_long, size_t *);
+	int	(*findoff)(const char *, size_t, u_long, size_t *, u_long);
 } exec_formats[] = {
 #ifdef NLIST_AOUT
 	{	"a.out",	check_aout,	findoff_aout,	},
@@ -139,8 +128,10 @@ main(int argc, char *argv[])
 	uint64_t uval64;
 	int64_t  sval64;
 	int ch, fd, rv, i, n;
+	u_long	text_start;		/* Start of kernel text (a.out) */
 
 	setprogname(argv[0]);
+	text_start = (unsigned long)~0;
 
 	while ((ch = getopt(argc, argv, "bwldT:a:s:o:r:v")) != -1)
 		switch (ch) {
@@ -182,15 +173,8 @@ main(int argc, char *argv[])
 			verbose = true;
 			break;
 		case 'T':
-#ifdef NLIST_AOUT
-			T_flag_specified = 1;
 			text_start = strtoul(optarg, NULL, 0);
 			break;
-#else
-			fprintf(stderr, "%s: unknown option -- %c\n",
-			getprogname(), (char)ch);
-			/*FALLTHROUGH*/
-#endif /* NLIST_AOUT */
 		case '?':
 		default:
 			usage();
@@ -251,15 +235,13 @@ main(int argc, char *argv[])
 	if (verbose) {
 		fprintf(stderr, "%s is an %s binary\n", fname,
 		exec_formats[i].name);
-#ifdef NLIST_AOUT
-		if (T_flag_specified)
+		if (text_start != (u_long)~0)
 			fprintf(stderr, "kernel text loads at 0x%lx\n",
 			text_start);
-#endif
 	}
 
 	if ((*exec_formats[i].findoff)(mappedfile, sb.st_size,
-	addr, ) != 0)
+	addr, , text_start) != 0)
 		errx(EXIT_FAILURE, "couldn't find file offset for %s in %s",
 		symbol != NULL ? nl[0].n_name : "address" , fname);
 
@@ -365,11 +347,7 @@ usage(void)
 {
 
 	fprintf(stderr,
-	"usage: %s [-b|-w|-l|-d] [-a address | -s symbol] [-o offset]\n"
-	"[-r value] "
-#ifdef NLIST_AOUT
-	"[-T text_start] "
-#endif
-	"[-v] binary\n", getprogname());
+	"Usage: %s [-b|-w|-l|-d] [-a address | -s symbol] [-o offset]"
+	" [-r value] [-T text_start] [-v] binary\n", getprogname());
 	exit(EXIT_FAILURE);
 }



CVS commit: src/sys/kern

2016-09-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Sep 22 16:22:29 UTC 2016

Modified Files:
src/sys/kern: vfs_wapbl.c

Log Message:
misplaced comment


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/kern/vfs_wapbl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.79 src/sys/kern/vfs_wapbl.c:1.80
--- src/sys/kern/vfs_wapbl.c:1.79	Thu Sep 22 16:20:56 2016
+++ src/sys/kern/vfs_wapbl.c	Thu Sep 22 16:22:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.79 2016/09/22 16:20:56 jdolecek Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.80 2016/09/22 16:22:29 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.79 2016/09/22 16:20:56 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.80 2016/09/22 16:22:29 jdolecek Exp $");
 
 #include 
 #include 
@@ -502,7 +502,6 @@ wapbl_start(struct wapbl ** wlp, struct 
 	/* XXX fix actual number of buffers reserved per filesystem. */
 	wl->wl_bufcount_max = (nbuf / 2) * 1024;
 
-	/* Calculate number of blocks described in a blocklist header */
 	wl->wl_brperjblock = ((1wc_blocks[0]);
@@ -2076,6 +2075,7 @@ wapbl_transaction_len(struct wapbl *wl)
 	int blocklen = 1wl_bcount;
 	len += howmany(wl->wl_bufcount, wl->wl_brperjblock) * blocklen;
 	len += howmany(wl->wl_dealloccnt, wl->wl_brperjblock) * blocklen;



CVS commit: src/sys/kern

2016-09-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Sep 22 16:20:56 UTC 2016

Modified Files:
src/sys/kern: vfs_wapbl.c

Log Message:
store the number of block records per block into wl as wl_brperjblock,
so that it's visible it's same value everywhere; no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/kern/vfs_wapbl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.78 src/sys/kern/vfs_wapbl.c:1.79
--- src/sys/kern/vfs_wapbl.c:1.78	Thu May 19 18:32:29 2016
+++ src/sys/kern/vfs_wapbl.c	Thu Sep 22 16:20:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.78 2016/05/19 18:32:29 riastradh Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.79 2016/09/22 16:20:56 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.78 2016/05/19 18:32:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.79 2016/09/22 16:20:56 jdolecek Exp $");
 
 #include 
 #include 
@@ -202,6 +202,10 @@ struct wapbl {
 	size_t wl_unsynced_bufbytes; /* Byte count of unsynced buffers */
 #endif
 
+#if _KERNEL
+	int wl_brperjblock;	/* r Block records per journal block */
+#endif
+
 	daddr_t *wl_deallocblks;/* lm:	address of block */
 	int *wl_dealloclens;	/* lm:	size of block */
 	int wl_dealloccnt;	/* lm:	total count */
@@ -498,6 +502,12 @@ wapbl_start(struct wapbl ** wlp, struct 
 	/* XXX fix actual number of buffers reserved per filesystem. */
 	wl->wl_bufcount_max = (nbuf / 2) * 1024;
 
+	/* Calculate number of blocks described in a blocklist header */
+	wl->wl_brperjblock = ((1wc_blocks[0]);
+	KASSERT(wl->wl_brperjblock > 0);
+
 	/* XXX tie this into resource estimation */
 	wl->wl_dealloclim = wl->wl_bufbytes_max / mp->mnt_stat.f_bsize / 2;
 	
@@ -2065,17 +2075,10 @@ wapbl_transaction_len(struct wapbl *wl)
 {
 	int blocklen = 1wc_blocks[0]);
-
-	KASSERT(bph > 0);
 
 	len = wl->wl_bcount;
-	len += howmany(wl->wl_bufcount, bph) * blocklen;
-	len += howmany(wl->wl_dealloccnt, bph) * blocklen;
+	len += howmany(wl->wl_bufcount, wl->wl_brperjblock) * blocklen;
+	len += howmany(wl->wl_dealloccnt, wl->wl_brperjblock) * blocklen;
 	len += wapbl_transaction_inodes_len(wl);
 
 	return len;
@@ -2228,7 +2231,6 @@ wapbl_write_blocks(struct wapbl *wl, off
 	struct wapbl_wc_blocklist *wc =
 	(struct wapbl_wc_blocklist *)wl->wl_wc_scratch;
 	int blocklen = 1wl_rwlock));
 
-	bph = (blocklen - offsetof(struct wapbl_wc_blocklist, wc_blocks)) /
-	sizeof(((struct wapbl_wc_blocklist *)0)->wc_blocks[0]);
-
 	bp = LIST_FIRST(>wl_bufs);
 
 	while (bp) {
@@ -2250,7 +2249,7 @@ wapbl_write_blocks(struct wapbl *wl, off
 		wc->wc_type = WAPBL_WC_BLOCKS;
 		wc->wc_len = blocklen;
 		wc->wc_blkcount = 0;
-		while (bp && (wc->wc_blkcount < bph)) {
+		while (bp && (wc->wc_blkcount < wl->wl_brperjblock)) {
 			/*
 			 * Make sure all the physical block numbers are up to
 			 * date.  If this is not always true on a given
@@ -2289,7 +2288,7 @@ wapbl_write_blocks(struct wapbl *wl, off
 			return error;
 		bp = obp;
 		cnt = 0;
-		while (bp && (cnt++ < bph)) {
+		while (bp && (cnt++ < wl->wl_brperjblock)) {
 			error = wapbl_circ_write(wl, bp->b_data,
 			bp->b_bcount, );
 			if (error)
@@ -2326,22 +2325,18 @@ wapbl_write_revocations(struct wapbl *wl
 	(struct wapbl_wc_blocklist *)wl->wl_wc_scratch;
 	int i;
 	int blocklen = 1wl_dealloccnt == 0)
 		return 0;
 
-	bph = (blocklen - offsetof(struct wapbl_wc_blocklist, wc_blocks)) /
-	sizeof(((struct wapbl_wc_blocklist *)0)->wc_blocks[0]);
-
 	i = 0;
 	while (i < wl->wl_dealloccnt) {
 		wc->wc_type = WAPBL_WC_REVOCATIONS;
 		wc->wc_len = blocklen;
 		wc->wc_blkcount = 0;
-		while ((i < wl->wl_dealloccnt) && (wc->wc_blkcount < bph)) {
+		while ((i < wl->wl_dealloccnt) && (wc->wc_blkcount < wl->wl_brperjblock)) {
 			wc->wc_blocks[wc->wc_blkcount].wc_daddr =
 			wl->wl_deallocblks[i];
 			wc->wc_blocks[wc->wc_blkcount].wc_dlen =



CVS commit: src/sys/fs/nfs

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 15:57:05 UTC 2016

Modified Files:
src/sys/fs/nfs: files.newnfs

Log Message:
add missing attribute


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/nfs/files.newnfs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/nfs/files.newnfs
diff -u src/sys/fs/nfs/files.newnfs:1.2 src/sys/fs/nfs/files.newnfs:1.3
--- src/sys/fs/nfs/files.newnfs:1.2	Sat Oct 11 02:42:18 2014
+++ src/sys/fs/nfs/files.newnfs	Thu Sep 22 11:57:05 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.newnfs,v 1.2 2014/10/11 06:42:18 uebayasi Exp $
+#	$NetBSD: files.newnfs,v 1.3 2016/09/22 15:57:05 christos Exp $
 
 deffs NEW_NFSCLIENT
 defflag opt_newnfs.h			NEW_NFS_BOOT_BOOTP
@@ -7,7 +7,7 @@ defflag opt_newnfs.h			NEW_NFS_BOOT_BOOT
 	NEW_NFS_BOOT
 
 # XXX
-define	new_nfsclient: vfs
+define	new_nfsclient: vfs, net
 file	fs/nfs/client/nfs_clbio.c	 new_nfsclient
 file	fs/nfs/client/nfs_clcomsubs.c	 new_nfsclient
 file	fs/nfs/client/nfs_clkrpc.c	 new_nfsclient



CVS commit: xsrc/external/mit/xfs/include

2016-09-22 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Thu Sep 22 15:50:17 UTC 2016

Modified Files:
xsrc/external/mit/xfs/include: config.h

Log Message:
Missed one, thanks Rin.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xfs/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xfs/include/config.h
diff -u xsrc/external/mit/xfs/include/config.h:1.2 xsrc/external/mit/xfs/include/config.h:1.3
--- xsrc/external/mit/xfs/include/config.h:1.2	Wed Feb 25 15:04:02 2015
+++ xsrc/external/mit/xfs/include/config.h	Thu Sep 22 11:50:17 2016
@@ -44,7 +44,9 @@
 #define HAVE_UNISTD_H 1
 
 /* Support IPv6 for TCP connections */
-#define IPv6 1
+#ifndef __NetBSD__	/* Defined by the build */
+# define IPv6 1
+#endif
 
 /* Support os-specific local connections */
 /* #undef LOCALCONN */



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 13:13:09 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
__NetBSD__ -> SANITIZER_NETBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8	Wed Sep 21 23:43:07 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Thu Sep 22 09:13:09 2016
@@ -13,7 +13,7 @@
 #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
 #define SANITIZER_PLATFORM_LIMITS_POSIX_H
 
-#ifdef __NetBSD__
+#if SANITIZER_NETBSD
 #define _SYS_SIGNAL_H_
 #include 
 #undef _SYS_SIGNAL_H_
@@ -343,7 +343,7 @@ namespace __sanitizer {
 # endif
 void *ifa_dstaddr; // (struct sockaddr *)
 void *ifa_data;
-# ifdef __NetBSD__
+# if SANITIZER_NETBSD
 #  if __NetBSD_Prereq__(7, 99, 39)
 unsigned int ifa_addrflags;
 #  endif



CVS commit: src/usr.sbin/mdsetimage

2016-09-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 22 08:43:26 UTC 2016

Modified Files:
src/usr.sbin/mdsetimage: mdsetimage.c

Log Message:
cast to intmax_t for machine-independent printing.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/mdsetimage/mdsetimage.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/usr.sbin/mdsetimage/mdsetimage.c:1.22 src/usr.sbin/mdsetimage/mdsetimage.c:1.23
--- src/usr.sbin/mdsetimage/mdsetimage.c:1.22	Wed Sep 21 16:29:48 2016
+++ src/usr.sbin/mdsetimage/mdsetimage.c	Thu Sep 22 08:43:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdsetimage.c,v 1.22 2016/09/21 16:29:48 christos Exp $	*/
+/*	$NetBSD: mdsetimage.c,v 1.23 2016/09/22 08:43:26 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1996, 2002 Christopher G. Demetriou
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1996\
  Christopher G. Demetriou.  All rights reserved.");
-__RCSID("$NetBSD: mdsetimage.c,v 1.22 2016/09/21 16:29:48 christos Exp $");
+__RCSID("$NetBSD: mdsetimage.c,v 1.23 2016/09/22 08:43:26 mlelstv Exp $");
 #endif /* not lint */
 
 #include 
@@ -167,8 +167,9 @@ main(int argc, char *argv[])
 		if ((uintmax_t)fssb.st_size != (size_t)fssb.st_size)
 			errx(1, "fs image is too big");
 		if (fssb.st_size > md_root_size_value)
-			errx(1, "fs image (%td bytes) too big for buffer"
-			" (%u bytes)", fssb.st_size, md_root_size_value);
+			errx(1, "fs image (%jd bytes) too big for buffer"
+			" (%u bytes)", (intmax_t) fssb.st_size,
+			md_root_size_value);
 		left_to_copy = fssb.st_size;
 	}
 
@@ -219,8 +220,8 @@ main(int argc, char *argv[])
 		char buf[sizeof(uint32_t)];
 
 		if (verbose)
-			fprintf(stderr, "setting md_root_size to %llu\n",
-			(unsigned long long) fssb.st_size);
+			fprintf(stderr, "setting md_root_size to %jd\n",
+			(intmax_t) fssb.st_size);
 		if (lseek(kfd, md_root_size_offset, SEEK_SET) !=
 		(off_t)md_root_size_offset)
 			err(1, "seek %s", kfile);



CVS commit: src/sys/arch/evbmips/conf

2016-09-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Sep 22 08:09:40 UTC 2016

Modified Files:
src/sys/arch/evbmips/conf: ERLITE

Log Message:
Add COMPAT_70 to ERLITE for ifa_msghdr changes.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbmips/conf/ERLITE

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/conf/ERLITE
diff -u src/sys/arch/evbmips/conf/ERLITE:1.12 src/sys/arch/evbmips/conf/ERLITE:1.13
--- src/sys/arch/evbmips/conf/ERLITE:1.12	Fri Aug 21 12:26:54 2015
+++ src/sys/arch/evbmips/conf/ERLITE	Thu Sep 22 08:09:40 2016
@@ -1,11 +1,11 @@
-#	$NetBSD: ERLITE,v 1.12 2015/08/21 12:26:54 jmcneill Exp $
+#	$NetBSD: ERLITE,v 1.13 2016/09/22 08:09:40 roy Exp $
 
 include 	"arch/mips/conf/std.octeon"
 include 	"arch/evbmips/conf/files.octeon"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ERLITE-$Revision: 1.12 $"
+#ident 		"ERLITE-$Revision: 1.13 $"
 
 maxusers	32
 
@@ -51,6 +51,7 @@ makeoptions	COPY_SYMTAB=1	# size for emb
 #options 	COMPAT_20	# NetBSD 2.0 binary compatibility
 #options 	COMPAT_30	# NetBSD 3.0 compatibility.
 #options 	COMPAT_40	# NetBSD 4.0 compatibility.
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
 #options 	EXEC_ECOFF	# exec ECOFF binaries
 #options 	COMPAT_ULTRIX	# binary compatibility with Ultrix
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.