CVS commit: src/usr.bin/xinstall

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 06:55:02 UTC 2016

Modified Files:
src/usr.bin/xinstall: xinstall.c

Log Message:
Move __MKTEMP_OK up earlier so it has an actual impact.  Reduces the
number of warnings during build.

XXX There are still some other warnings remaining to be resolved.

Fixes PR bin/48195 although we really should go back someday and fix
this correctly (by replacing all uses of mktemp(3)!)


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xinstall/xinstall.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.bin/xinstall/xinstall.c
diff -u src/usr.bin/xinstall/xinstall.c:1.124 src/usr.bin/xinstall/xinstall.c:1.125
--- src/usr.bin/xinstall/xinstall.c:1.124	Fri Jun 19 17:20:02 2015
+++ src/usr.bin/xinstall/xinstall.c	Tue May 31 06:55:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: xinstall.c,v 1.124 2015/06/19 17:20:02 christos Exp $	*/
+/*	$NetBSD: xinstall.c,v 1.125 2016/05/31 06:55:02 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -29,6 +29,8 @@
  * SUCH DAMAGE.
  */
 
+#define __MKTEMP_OK__	/* All uses of mktemp have been checked */
+
 #if HAVE_NBTOOL_CONFIG_H
 #include "nbtool_config.h"
 #else
@@ -46,11 +48,10 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)xinstall.c	8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.124 2015/06/19 17:20:02 christos Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.125 2016/05/31 06:55:02 pgoyette Exp $");
 #endif
 #endif /* not lint */
 
-#define __MKTEMP_OK__	/* All uses of mktemp have been checked */
 #include 
 #include 
 #include 



CVS commit: src/share/man/man3

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 06:00:39 UTC 2016

Modified Files:
src/share/man/man3: queue.3

Log Message:
Correct list of operations to note that SLISTs and SIMPLEQs cannot insert
entries before existing entries.  This can only be done for LISTs and
TAILQs.

Fixes PR kern/50845


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/share/man/man3/queue.3

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

Modified files:

Index: src/share/man/man3/queue.3
diff -u src/share/man/man3/queue.3:1.51 src/share/man/man3/queue.3:1.52
--- src/share/man/man3/queue.3:1.51	Tue Feb  2 12:25:24 2016
+++ src/share/man/man3/queue.3	Tue May 31 06:00:38 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: queue.3,v 1.51 2016/02/02 12:25:24 ryoon Exp $
+.\"	$NetBSD: queue.3,v 1.52 2016/05/31 06:00:38 pgoyette Exp $
 .\"
 .\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"	@(#)queue.3	8.1 (Berkeley) 12/13/93
 .\"
-.Dd February 2, 2016
+.Dd May 31, 2016
 .Dt QUEUE 3
 .Os
 .Sh NAME
@@ -256,7 +256,7 @@ All five structures support the followin
 .It
 Insertion of a new entry at the head of the list.
 .It
-Insertion of a new entry before or after any element in the list.
+Insertion of a new entry after any element in the list.
 .It
 Removal of any entry in the list.
 .It



CVS commit: src

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 05:44:19 UTC 2016

Modified Files:
src/share/man/man7: sysctl.7
src/sys/kern: init_sysctl.c

Log Message:
Add a new kern.messages sysctl to allow kernel message verbosity to be
altered after boot.

Fixes PR kern/46539 using patch submitted by Nat Sloss.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/init_sysctl.c

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

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.101 src/share/man/man7/sysctl.7:1.102
--- src/share/man/man7/sysctl.7:1.101	Wed May 25 20:47:57 2016
+++ src/share/man/man7/sysctl.7	Tue May 31 05:44:19 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.101 2016/05/25 20:47:57 wiz Exp $
+.\"	$NetBSD: sysctl.7,v 1.102 2016/05/31 05:44:19 pgoyette Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\"
-.Dd May 25, 2016
+.Dd May 31, 2016
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -315,6 +315,7 @@ privilege may change the value.
 .It kern.maxproc	integer	yes
 .It kern.maxptys	integer	yes
 .It kern.maxvnodes	integer	yes
+.It kern.messages	integer yes
 .It kern.mbuf	node	not applicable
 .It kern.memlock	integer	no
 .It kern.memlock_range	integer	no
@@ -739,6 +740,18 @@ Returns 1 if the
 .St -p1003.1b-93
 Memory Protection Option is available on this system,
 otherwise\ 0.
+.It Li kern.messages
+Kernel console message verbosity.
+See
+.Sy \
+.Bl -column "verbosity" "setting" -offset indent
+.It Sy Verbosity   Setting
+.It \ \ \ \ 0  Silent Sy AB_SILENT
+.It \ \ \ \ 1  Quiet Sy AB_QUIET
+.It \ \ \ \ 2  Normal Sy AB_NORMAL
+.It \ \ \ \ 3  Verbose Sy AB_VERBOSE
+.It \ \ \ \ 4  Debug Sy AB_DEBUG
+.El
 .It Li kern.module
 Settings related to kernel modules.
 The third level names for the settings are described below.

Index: src/sys/kern/init_sysctl.c
diff -u src/sys/kern/init_sysctl.c:1.210 src/sys/kern/init_sysctl.c:1.211
--- src/sys/kern/init_sysctl.c:1.210	Mon Nov  9 01:21:18 2015
+++ src/sys/kern/init_sysctl.c	Tue May 31 05:44:19 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_sysctl.c,v 1.210 2015/11/09 01:21:18 pgoyette Exp $ */
+/*	$NetBSD: init_sysctl.c,v 1.211 2016/05/31 05:44:19 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.210 2015/11/09 01:21:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.211 2016/05/31 05:44:19 pgoyette Exp $");
 
 #include "opt_sysv.h"
 #include "opt_compat_netbsd.h"
@@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: init_sysctl.
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -110,6 +111,7 @@ dcopyout(struct lwp *l, const void *kadd
 static int sysctl_kern_trigger_panic(SYSCTLFN_PROTO);
 #endif
 static int sysctl_kern_maxvnodes(SYSCTLFN_PROTO);
+static int sysctl_kern_messages(SYSCTLFN_PROTO);
 static int sysctl_kern_rtc_offset(SYSCTLFN_PROTO);
 static int sysctl_kern_maxproc(SYSCTLFN_PROTO);
 static int sysctl_kern_hostid(SYSCTLFN_PROTO);
@@ -590,6 +592,12 @@ SYSCTL_SETUP(sysctl_kern_setup, "sysctl 
 			SYSCTL_DESCR("Information from build environment"),
 			NULL, 0, __UNCONST(buildinfo), 0,
 			CTL_KERN, CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+			CTLTYPE_INT, "messages",
+			SYSCTL_DESCR("Kernel message verbosity"),
+			sysctl_kern_messages, 0, NULL, 0,
+			CTL_KERN, CTL_CREATE, CTL_EOL);
 }
 
 SYSCTL_SETUP(sysctl_hw_misc_setup, "sysctl hw subtree misc setup")
@@ -760,6 +768,72 @@ sysctl_kern_maxvnodes(SYSCTLFN_ARGS)
 }
 
 /*
+ * sysctl helper routine for kern.messages.
+ * Alters boothowto to display kernel messages in increasing verbosity
+ * from 0 to 4.
+ */
+
+#define MAXMESSAGES4
+static int
+sysctl_kern_messages(SYSCTLFN_ARGS)
+{
+	int error, messageverbose, messagemask, newboothowto;
+	struct sysctlnode node;
+
+	messagemask = (AB_NORMAL|AB_QUIET|AB_SILENT|AB_VERBOSE|AB_DEBUG);
+	switch (boothowto & messagemask) {
+	case AB_SILENT:
+		messageverbose = 0;
+		break;
+	case AB_QUIET:
+		messageverbose = 1;
+		break;
+	case AB_VERBOSE:
+		messageverbose = 3;
+		break;
+	case AB_DEBUG:
+		messageverbose = 4;
+		break;
+	case AB_NORMAL:
+	default:
+		messageverbose = 2;
+}
+
+	node = *rnode;
+	node.sysctl_data = &messageverbose;
+	error = sysctl_lookup(SYSCTLFN_CALL(&node));
+	if (error || newp == NULL)
+		return (error);
+	if (messageverbose < 0 || messageverbose > MAXMESSAGES)
+		return EINVAL;
+
+	/* Set boothowto */
+	newboothowto = boothowto & ~messagemask;
+
+	switch (messageverbose) {
+	case 0:
+		newboothowto |= AB_SILENT;
+		break;
+	case 1:
+		newboothowto |= AB_QUIET;
+		break;
+	case 3:
+		

CVS commit: src/sys/arch/zaurus/zaurus

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 04:14:12 UTC 2016

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
PR 51196 David Binderman: simplify redundant conditional.
(yet another copy)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.35 src/sys/arch/zaurus/zaurus/machdep.c:1.36
--- src/sys/arch/zaurus/zaurus/machdep.c:1.35	Sun Aug 18 21:42:16 2013
+++ src/sys/arch/zaurus/zaurus/machdep.c	Tue May 31 04:14:12 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.35 2013/08/18 21:42:16 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.36 2016/05/31 04:14:12 dholland Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2013/08/18 21:42:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.36 2016/05/31 04:14:12 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1205,7 +1205,7 @@ gettrailer(char *arg)
 		*options++ = '\0';
 
 	/* trim leading blanks */
-	while (*options && *options == ' ')
+	while (*options == ' ')
 		options++;
 
 	return options;



CVS commit: src/sys/arch/zaurus/stand/zboot

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 04:13:26 UTC 2016

Modified Files:
src/sys/arch/zaurus/stand/zboot: boot.c

Log Message:
PR 51195 David Binderman: simplify redundant conditional.

XXX: there are too many copies of this function floating around ("gettrailer")


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zboot/boot.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/zaurus/stand/zboot/boot.c
diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.6 src/sys/arch/zaurus/stand/zboot/boot.c:1.7
--- src/sys/arch/zaurus/stand/zboot/boot.c:1.6	Sat Jun 28 09:16:18 2014
+++ src/sys/arch/zaurus/stand/zboot/boot.c	Tue May 31 04:13:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.6 2014/06/28 09:16:18 rtr Exp $	*/
+/*	$NetBSD: boot.c,v 1.7 2016/05/31 04:13:26 dholland Exp $	*/
 
 /*
  * Copyright (c) 2009 NONAKA Kimihiro 
@@ -445,7 +445,7 @@ gettrailer(char *arg)
 		*options++ = '\0';
 
 	/* trim leading blanks */
-	while (*options && *options == ' ')
+	while (*options == ' ')
 		options++;
 
 	return options;



CVS commit: src/sys/arch/x68k/stand/libsa

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 04:12:10 UTC 2016

Modified Files:
src/sys/arch/x68k/stand/libsa: parseutils.c

Log Message:
PR 51194 David Binderman: simplify redundant conditional


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/libsa/parseutils.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/x68k/stand/libsa/parseutils.c
diff -u src/sys/arch/x68k/stand/libsa/parseutils.c:1.2 src/sys/arch/x68k/stand/libsa/parseutils.c:1.3
--- src/sys/arch/x68k/stand/libsa/parseutils.c:1.2	Sun Nov 11 05:20:27 2007
+++ src/sys/arch/x68k/stand/libsa/parseutils.c	Tue May 31 04:12:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: parseutils.c,v 1.2 2007/11/11 05:20:27 isaki Exp $	*/
+/*	$NetBSD: parseutils.c,v 1.3 2016/05/31 04:12:10 dholland Exp $	*/
 
 /*
  *	from /sys/arch/i386/lib/parseutils.c
@@ -64,7 +64,7 @@ gettrailer(char *arg)
 		*options++ = '\0';
 
 	/* trim leading blanks */
-	while (*options && *options == ' ')
+	while (*options == ' ')
 		options++;
 
 	return options;



CVS commit: src/sys/arch/landisk/stand/boot

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 04:05:50 UTC 2016

Modified Files:
src/sys/arch/landisk/stand/boot: boot2.c

Log Message:
PR 51193 David Binderman: simplify redundant conditional.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/landisk/stand/boot/boot2.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/landisk/stand/boot/boot2.c
diff -u src/sys/arch/landisk/stand/boot/boot2.c:1.4 src/sys/arch/landisk/stand/boot/boot2.c:1.5
--- src/sys/arch/landisk/stand/boot/boot2.c:1.4	Wed Mar 26 17:47:10 2014
+++ src/sys/arch/landisk/stand/boot/boot2.c	Tue May 31 04:05:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.4 2014/03/26 17:47:10 christos Exp $	*/
+/*	$NetBSD: boot2.c,v 1.5 2016/05/31 04:05:50 dholland Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -442,7 +442,7 @@ gettrailer(char *arg)
 		*options++ = '\0';
 
 	/* trim leading blanks */
-	while (*options && *options == ' ')
+	while (*options == ' ')
 		options++;
 
 	return (options);



CVS commit: src/sys/net

2016-05-30 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue May 31 04:05:01 UTC 2016

Modified Files:
src/sys/net: if.c

Log Message:
Optimize if_get_byindex by adding __predict_true


To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.336 src/sys/net/if.c:1.337
--- src/sys/net/if.c:1.336	Mon May 16 01:16:24 2016
+++ src/sys/net/if.c	Tue May 31 04:05:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.336 2016/05/16 01:16:24 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.337 2016/05/31 04:05:01 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.336 2016/05/16 01:16:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.337 2016/05/31 04:05:01 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2215,8 +2215,8 @@ if_get_byindex(u_int idx, struct psref *
 	int s;
 
 	s = pserialize_read_enter();
-	ifp = (idx < if_indexlim) ? ifindex2ifnet[idx] : NULL;
-	if (ifp != NULL)
+	ifp = (__predict_true(idx < if_indexlim)) ? ifindex2ifnet[idx] : NULL;
+	if (__predict_true(ifp != NULL))
 		psref_acquire(psref, &ifp->if_psref, ifnet_psref_class);
 	pserialize_read_exit(s);
 



CVS commit: src/sys/kern

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 03:57:04 UTC 2016

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

Log Message:
Compare names of duplicate symbols properly, so we correctly return
an error status.

Fixes PR kern/45125 with patch supplied by Akinobu  Mita


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.51 src/sys/kern/subr_kobj.c:1.52
--- src/sys/kern/subr_kobj.c:1.51	Mon Aug 24 22:50:32 2015
+++ src/sys/kern/subr_kobj.c	Tue May 31 03:57:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.51 2015/08/24 22:50:32 pooka Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.52 2016/05/31 03:57:04 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.51 2015/08/24 22:50:32 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.52 2016/05/31 03:57:04 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -906,7 +906,7 @@ kobj_checksyms(kobj_t ko, bool undefined
 		strcmp(name, "__end") == 0 ||
 		strcmp(name, "__end__") == 0 ||
 		strncmp(name, "__start_link_set_", 17) == 0 ||
-		strncmp(name, "__stop_link_set_", 16)) {
+		strncmp(name, "__stop_link_set_", 16) == 0) {
 			continue;
 		}
 		kobj_error(ko, "global symbol `%s' redefined",



CVS commit: src/sys/net

2016-05-30 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue May 31 03:52:40 UTC 2016

Modified Files:
src/sys/net: if_gif.c if_gif.h

Log Message:
modify some functions static. no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/net/if_gif.c
cvs rdiff -u -r1.22 -r1.23 src/sys/net/if_gif.h

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

Modified files:

Index: src/sys/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.108 src/sys/net/if_gif.c:1.109
--- src/sys/net/if_gif.c:1.108	Thu Apr 28 00:16:56 2016
+++ src/sys/net/if_gif.c	Tue May 31 03:52:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.108 2016/04/28 00:16:56 ozaki-r Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.109 2016/05/31 03:52:40 knakahara Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.108 2016/04/28 00:16:56 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.109 2016/05/31 03:52:40 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -92,6 +92,14 @@ static void	gifintr(void *);
  */
 static LIST_HEAD(, gif_softc) gif_softc_list;
 
+static void	gifattach0(struct gif_softc *);
+static int	gif_output(struct ifnet *, struct mbuf *,
+			   const struct sockaddr *, const struct rtentry *);
+static int	gif_ioctl(struct ifnet *, u_long, void *);
+static int	gif_set_tunnel(struct ifnet *, struct sockaddr *,
+			   struct sockaddr *);
+static void	gif_delete_tunnel(struct ifnet *);
+
 static void	gif_sysctl_setup(struct sysctllog **);
 
 static int	gif_clone_create(struct if_clone *, int);
@@ -169,7 +177,7 @@ gif_clone_create(struct if_clone *ifc, i
 	return (0);
 }
 
-void
+static void
 gifattach0(struct gif_softc *sc)
 {
 
@@ -304,7 +312,7 @@ gif_check_nesting(struct ifnet *ifp, str
 	return 0;
 }
 
-int
+static int
 gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
 const struct rtentry *rt)
 {
@@ -488,7 +496,7 @@ gif_input(struct mbuf *m, int af, struct
 }
 
 /* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
-int
+static int
 gif_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct gif_softc *sc  = ifp->if_softc;
@@ -775,7 +783,7 @@ gif_encap_detach(struct gif_softc *sc)
 	return error;
 }
 
-int
+static int
 gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
 {
 	struct gif_softc *sc = ifp->if_softc;
@@ -903,7 +911,7 @@ gif_set_tunnel(struct ifnet *ifp, struct
 	return error;
 }
 
-void
+static void
 gif_delete_tunnel(struct ifnet *ifp)
 {
 	struct gif_softc *sc = ifp->if_softc;

Index: src/sys/net/if_gif.h
diff -u src/sys/net/if_gif.h:1.22 src/sys/net/if_gif.h:1.23
--- src/sys/net/if_gif.h:1.22	Thu Apr 28 00:16:56 2016
+++ src/sys/net/if_gif.h	Tue May 31 03:52:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.h,v 1.22 2016/04/28 00:16:56 ozaki-r Exp $	*/
+/*	$NetBSD: if_gif.h,v 1.23 2016/05/31 03:52:40 knakahara Exp $	*/
 /*	$KAME: if_gif.h,v 1.23 2001/07/27 09:21:42 itojun Exp $	*/
 
 /*
@@ -70,13 +70,8 @@ struct gif_softc {
 #define	GIF_MTU_MAX	(8192)	/* Maximum MTU */
 
 /* Prototypes */
-void	gifattach0(struct gif_softc *);
 void	gif_input(struct mbuf *, int, struct ifnet *);
-int	gif_output(struct ifnet *, struct mbuf *,
-		   const struct sockaddr *, const struct rtentry *);
-int	gif_ioctl(struct ifnet *, u_long, void *);
-int	gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
-void	gif_delete_tunnel(struct ifnet *);
+
 #ifdef GIF_ENCAPCHECK
 int	gif_encapcheck(struct mbuf *, int, int, void *);
 #endif



CVS commit: src/sys/arch/algor/dev

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:51:55 UTC 2016

Modified Files:
src/sys/arch/algor/dev: bonito_mainbus.c

Log Message:
If ALGOR_P6032 is not defined, set sc_bonito to NULL instead of using
random garbage off the stack. PR 51012 from David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/algor/dev/bonito_mainbus.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/algor/dev/bonito_mainbus.c
diff -u src/sys/arch/algor/dev/bonito_mainbus.c:1.16 src/sys/arch/algor/dev/bonito_mainbus.c:1.17
--- src/sys/arch/algor/dev/bonito_mainbus.c:1.16	Tue Jun  9 22:47:12 2015
+++ src/sys/arch/algor/dev/bonito_mainbus.c	Tue May 31 03:51:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bonito_mainbus.c,v 1.16 2015/06/09 22:47:12 matt Exp $	*/
+/*	$NetBSD: bonito_mainbus.c,v 1.17 2016/05/31 03:51:55 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.16 2015/06/09 22:47:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.17 2016/05/31 03:51:55 dholland Exp $");
 
 #include "opt_algor_p6032.h"
 
@@ -85,6 +85,9 @@ bonito_mainbus_attach(device_t parent, d
 	 */
 #if defined(ALGOR_P6032)
 	bc = &p6032_configuration.ac_bonito;
+#else
+	/* I guess... XXX? */
+	bc = NULL;
 #endif
 	sc->sc_bonito = bc;
 



CVS commit: src/sys/arch/macppc/dev

2016-05-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May 31 03:50:30 UTC 2016

Modified Files:
src/sys/arch/macppc/dev: pmu.c

Log Message:
fix stupid tpyo
thanks chuq


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/macppc/dev/pmu.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/macppc/dev/pmu.c
diff -u src/sys/arch/macppc/dev/pmu.c:1.25 src/sys/arch/macppc/dev/pmu.c:1.26
--- src/sys/arch/macppc/dev/pmu.c:1.25	Tue May 31 02:17:18 2016
+++ src/sys/arch/macppc/dev/pmu.c	Tue May 31 03:50:30 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmu.c,v 1.25 2016/05/31 02:17:18 macallan Exp $ */
+/*	$NetBSD: pmu.c,v 1.26 2016/05/31 03:50:30 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.25 2016/05/31 02:17:18 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.26 2016/05/31 03:50:30 macallan Exp $");
 
 #include 
 #include 
@@ -1025,7 +1025,7 @@ pmu_thread(void *cookie)
 		}
 
 		if (sc->sc_pswitch_pending) {
-			sc->sc_pswitch_pending = 1;
+			sc->sc_pswitch_pending = 0;
 			sysmon_pswitch_event(&sc->sc_lidswitch, 
 			sc->sc_lid_closed ? PSWITCH_EVENT_PRESSED : 
 			PSWITCH_EVENT_RELEASED);



CVS commit: src/lib/libc/time

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:47:49 UTC 2016

Modified Files:
src/lib/libc/time: zic.c

Log Message:
PR 51003 David Binderman: bzero struct before passing it around.

This is actually unnecessary as the call in question uses only fields
that have been set explicitly, but good practice regardless and it's
not like it's on a performance-critical path.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/lib/libc/time/zic.c

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/zic.c
diff -u src/lib/libc/time/zic.c:1.57 src/lib/libc/time/zic.c:1.58
--- src/lib/libc/time/zic.c:1.57	Tue Mar 15 15:16:01 2016
+++ src/lib/libc/time/zic.c	Tue May 31 03:47:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: zic.c,v 1.57 2016/03/15 15:16:01 christos Exp $	*/
+/*	$NetBSD: zic.c,v 1.58 2016/05/31 03:47:49 dholland Exp $	*/
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -10,7 +10,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.57 2016/03/15 15:16:01 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.58 2016/05/31 03:47:49 dholland Exp $");
 #endif /* !defined lint */
 
 #include "private.h"
@@ -2551,6 +2551,7 @@ error(_("can't determine time zone abbre
 		*/
 		struct rule xr;
 		struct attype *lastat;
+		memset(&xr, 0, sizeof(xr));
 		xr.r_month = TM_JANUARY;
 		xr.r_dycode = DC_DOM;
 		xr.r_dayofmonth = 1;



CVS commit: src/lib/libc/gen

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:43:10 UTC 2016

Modified Files:
src/lib/libc/gen: getnetgrent.c

Log Message:
PR 51002 David Binderman: fix wrong printing code not enabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/gen/getnetgrent.c

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/gen/getnetgrent.c
diff -u src/lib/libc/gen/getnetgrent.c:1.42 src/lib/libc/gen/getnetgrent.c:1.43
--- src/lib/libc/gen/getnetgrent.c:1.42	Tue Mar 20 16:36:05 2012
+++ src/lib/libc/gen/getnetgrent.c	Tue May 31 03:43:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getnetgrent.c,v 1.42 2012/03/20 16:36:05 matt Exp $	*/
+/*	$NetBSD: getnetgrent.c,v 1.43 2016/05/31 03:43:10 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994 Christos Zoulas
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnetgrent.c,v 1.42 2012/03/20 16:36:05 matt Exp $");
+__RCSID("$NetBSD: getnetgrent.c,v 1.43 2016/05/31 03:43:10 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -166,8 +166,8 @@ getnetgroup(char **pp)
 #ifdef DEBUG_NG
 	{
 		char buf[1024];
-		(void) fprintf(stderr, "netgroup %s\n",
-		_ng_print(buf, sizeof(buf), ng));
+		_ng_print(buf, sizeof(buf), ng);
+		(void) fprintf(stderr, "netgroup %s\n", buf);
 	}
 #endif
 	return ng;



CVS commit: src/lib/libc/citrus/modules

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:34:14 UTC 2016

Modified Files:
src/lib/libc/citrus/modules: citrus_johab.c

Log Message:
PR 51000 David Binderman: comment out unused assignment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/modules/citrus_johab.c

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/citrus/modules/citrus_johab.c
diff -u src/lib/libc/citrus/modules/citrus_johab.c:1.5 src/lib/libc/citrus/modules/citrus_johab.c:1.6
--- src/lib/libc/citrus/modules/citrus_johab.c:1.5	Tue May 28 16:57:56 2013
+++ src/lib/libc/citrus/modules/citrus_johab.c	Tue May 31 03:34:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $ */
+/* $NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -27,7 +27,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -349,7 +349,7 @@ _citrus_JOHAB_stdenc_cstowc(_JOHABEncodi
 		l = ((idx >> 8) & 0xFF) - n;
 		t = (idx & 0xFF) - 0x21;
 		linear = (l * 94) + t;
-		l = (linear / 188) + m;
+		/*l = (linear / 188) + m;*/
 		t = linear % 188;
 		t += (t <= 0x4D) ? 0x31 : 0x43;
 		break;



CVS commit: src/bin/pax

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:32:36 UTC 2016

Modified Files:
src/bin/pax: ar_io.c

Log Message:
Don't use the length return from snprintf to write out the result
buffer. If snprintf truncated the output, the length returned will be
greater and we'll write trash. Just call strlen instead. (And since
what we're doing is writing progress messages to the user, checking
carefully for truncation isn't really worthwhile either.)

Spotted when attending to PR 50998 from David Binderman; the issue
there (computation of an unused value) popped up because one of the
prints was already calling strlen.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/pax/ar_io.c

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

Modified files:

Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.56 src/bin/pax/ar_io.c:1.57
--- src/bin/pax/ar_io.c:1.56	Mon Mar  9 23:38:08 2015
+++ src/bin/pax/ar_io.c	Tue May 31 03:32:36 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $	*/
+/*	$NetBSD: ar_io.c,v 1.57 2016/05/31 03:32:36 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)ar_io.c	8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $");
+__RCSID("$NetBSD: ar_io.c,v 1.57 2016/05/31 03:32:36 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -1631,7 +1631,6 @@ void
 ar_summary(int n)
 {
 	time_t secs;
-	int len;
 	char buf[BUFSIZ];
 	char tbuf[MAXPATHLEN/4];	/* XXX silly size! */
 	char s1buf[MAXPATHLEN/8];	/* XXX very silly size! */
@@ -1657,33 +1656,32 @@ ar_summary(int n)
 	 * could have written anything yet.
 	 */
 	if (frmt == NULL && act != COPY) {
-		len = snprintf(buf, sizeof(buf),
+		snprintf(buf, sizeof(buf),
 		"unknown format, %s skipped in %s\n",
 		sizefmt(s1buf, sizeof(s1buf), rdcnt),
 		timefmt(tbuf, sizeof(tbuf), rdcnt, secs, "bytes"));
 		if (n == 0)
 			(void)fprintf(outf, "%s: %s", argv0, buf);
 		else
-			(void)write(STDERR_FILENO, buf, len);
+			(void)write(STDERR_FILENO, buf, strlen(buf));
 		return;
 	}
 
 
 	if (n != 0 && *archd.name) {
-		len = snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n",
+		snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n",
 		archd.name, sizefmt(s1buf, sizeof(s1buf), archd.sb.st_size));
-		(void)write(STDERR_FILENO, buf, len);
-		len = 0;
+		(void)write(STDERR_FILENO, buf, strlen(buf));
 	}
 
 
 	if (act == COPY) {
-		len = snprintf(buf, sizeof(buf),
+		snprintf(buf, sizeof(buf),
 		"%lu files in %s\n",
 		(unsigned long)flcnt,
 		timefmt(tbuf, sizeof(tbuf), flcnt, secs, "files"));
 	} else {
-		len = snprintf(buf, sizeof(buf),
+		snprintf(buf, sizeof(buf),
 		"%s vol %d, %lu files, %s read, %s written in %s\n",
 		frmt->name, arvol-1, (unsigned long)flcnt,
 		sizefmt(s1buf, sizeof(s1buf), rdcnt),



CVS commit: src/sys/arch/mvme68k/mvme68k

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:25:46 UTC 2016

Modified Files:
src/sys/arch/mvme68k/mvme68k: machdep.c

Log Message:
PR 50792 David Binderman: make sure we don't divide by zero.

The loop that picks delay_divisor might conceivably reject all values,
particularly if the hardware is sulking for some reason; in that case
it'll be left zero. Use 1 instead of 0 so we don't then crash.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/arch/mvme68k/mvme68k/machdep.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/mvme68k/mvme68k/machdep.c
diff -u src/sys/arch/mvme68k/mvme68k/machdep.c:1.153 src/sys/arch/mvme68k/mvme68k/machdep.c:1.154
--- src/sys/arch/mvme68k/mvme68k/machdep.c:1.153	Mon Mar 24 19:52:27 2014
+++ src/sys/arch/mvme68k/mvme68k/machdep.c	Tue May 31 03:25:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.153 2014/03/24 19:52:27 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.154 2016/05/31 03:25:46 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.153 2014/03/24 19:52:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.154 2016/05/31 03:25:46 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m060sp.h"
@@ -309,6 +309,10 @@ mvme147_init(void)
 		bus_space_write_1(bt, bh, PCCREG_TMR1_CONTROL, PCC_TIMERCLEAR);
 		/* retry! */
 	}
+	/* just in case */
+	if (delay_divisor == 0) {
+		delay_divisor = 1;
+	}
 
 	bus_space_unmap(bt, bh, PCCREG_SIZE);
 



CVS commit: src/sys/arch/x68k/dev

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:22:30 UTC 2016

Modified Files:
src/sys/arch/x68k/dev: zs.c

Log Message:
PR 50759 David Binderman: fix out of bounds array access.

If we don't find one of the expected device addresses, reject the
match, but do it by checking whether the loop matched something rather
than by testing an array entry that might be one past the end.

Note: I have also moved the test to be with the loop; since the call
to intio_map_allocate_region had gotten placed in between them, I've
moved it to go before rather than after them as (a) it doesn't
interact with the loop itself and (b) this seems like the best choice
given the history as it was deliberately added before the original
test.

I have not tried running this, not having an x68k, but as best I can
tell by reading the intio code it seems like it should be harmless
even if it's not really correct.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x68k/dev/zs.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/x68k/dev/zs.c
diff -u src/sys/arch/x68k/dev/zs.c:1.42 src/sys/arch/x68k/dev/zs.c:1.43
--- src/sys/arch/x68k/dev/zs.c:1.42	Wed Mar 26 08:17:32 2014
+++ src/sys/arch/x68k/dev/zs.c	Tue May 31 03:22:30 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.42 2014/03/26 08:17:32 christos Exp $	*/
+/*	$NetBSD: zs.c,v 1.43 2016/05/31 03:22:30 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998 Minoura Makoto
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.42 2014/03/26 08:17:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.43 2016/05/31 03:22:30 dholland Exp $");
 
 #include 
 #include 
@@ -148,16 +148,18 @@ zs_match(device_t parent, cfdata_t cf, v
 	if (strcmp(ia->ia_name, "zsc") != 0)
 		return 0;
 
-	for (i = 0; i < ZS_MAXDEV; i++)
-		if (zsaddr == (void *)zs_physaddr[i]) /* XXX */
-			break;
-
 	ia->ia_size = 8;
 	if (intio_map_allocate_region(parent, ia, INTIO_MAP_TESTONLY))
 		return 0;
 
-	if (zsaddr != (void *)zs_physaddr[i])
+	for (i = 0; i < ZS_MAXDEV; i++)
+		if (zsaddr == (void *)zs_physaddr[i]) /* XXX */
+			break;
+	if (i == ZS_MAXDEV) {
+		/* not a recognized address */
 		return 0;
+	}
+
 	if (badaddr((void *)IIOV(zsaddr)))
 		return 0;
 



CVS commit: src/sys/arch/x68k/dev

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:12:49 UTC 2016

Modified Files:
src/sys/arch/x68k/dev: intio.c

Log Message:
fix flagrantly wrong indent


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/x68k/dev/intio.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/x68k/dev/intio.c
diff -u src/sys/arch/x68k/dev/intio.c:1.44 src/sys/arch/x68k/dev/intio.c:1.45
--- src/sys/arch/x68k/dev/intio.c:1.44	Fri Feb 26 18:19:16 2016
+++ src/sys/arch/x68k/dev/intio.c	Tue May 31 03:12:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intio.c,v 1.44 2016/02/26 18:19:16 christos Exp $	*/
+/*	$NetBSD: intio.c,v 1.45 2016/05/31 03:12:49 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.44 2016/02/26 18:19:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.45 2016/05/31 03:12:49 dholland Exp $");
 
 #include 
 #include 
@@ -236,7 +236,7 @@ intio_map_allocate_region(device_t paren
 #endif
 	if (r == 0) {
 		if (flag != INTIO_MAP_ALLOCATE)
-		extent_free(map, ia->ia_addr, ia->ia_size, 0);
+			extent_free(map, ia->ia_addr, ia->ia_size, 0);
 		return 0;
 	}
 



CVS commit: src/usr.sbin/sysinst/arch/mac68k

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 02:49:50 UTC 2016

Modified Files:
src/usr.sbin/sysinst/arch/mac68k: md.c

Log Message:
Disable the code that tries to prepare a new partition table (but doesn't
do anything with it...) because it's zooming off the end of the array it's
trying to use.

It looks to me as if NEW_MAP_SIZE has been accidentally used as both
the number of blocks occupied by the new partition table and also the
number of entries in it. Or something. This needs platform knowledge
to sort out. XXX.

Workaround for PR 50757.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/arch/mac68k/md.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/sysinst/arch/mac68k/md.c
diff -u src/usr.sbin/sysinst/arch/mac68k/md.c:1.4 src/usr.sbin/sysinst/arch/mac68k/md.c:1.5
--- src/usr.sbin/sysinst/arch/mac68k/md.c:1.4	Mon May 11 12:57:55 2015
+++ src/usr.sbin/sysinst/arch/mac68k/md.c	Tue May 31 02:49:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.4 2015/05/11 12:57:55 martin Exp $ */
+/*	$NetBSD: md.c,v 1.5 2016/05/31 02:49:50 dholland Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -173,6 +173,21 @@ md_get_info(void)
 	 *  need to completely initialize the disk.
 	 */
 	pm->dlsize = disklabel.d_secperunit;
+/*
+ * XXX this code is broken: it accesses off the end of new_map[],
+ * because NEW_MAP_SIZE is substantially larger than the number of
+ * entries in new_map[]. Based on the description of struct
+ * apple_part_map_entry in sys/bootblock.h, and the usage of it in
+ * new_map[], NEW_MAP_SIZE is expected to be a block count, not an
+ * entry count. As far I can tell the logic here is just wrong; it
+ * needs someone with platform knowledge to sort it out.
+ *
+ * Note that nothing uses the data this writes into new_map[] so
+ * disabling it should have no adverse consequences.
+ *
+ *   - dholland 20160530
+ */
+#if 0 /* XXX broken */
 	for (i=0;i 0)
 		new_map[i].pmPyPartStart = new_map[i-1].pmPyPartStart +
@@ -185,6 +200,7 @@ md_get_info(void)
 	   }
 	   pm->dlsize -= new_map[i].pmPartBlkCnt;
 	}
+#endif /* 0 - broken */
 	pm->dlsize = disklabel.d_secperunit;
 #if 0
 	msg_display(MSG_dldebug, blk_size, pm->dlcyl, pm->dlhead, pm->dlsec, pm->dlsize);



CVS commit: src/distrib/sets/lists/xbase

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 02:37:16 UTC 2016

Modified Files:
src/distrib/sets/lists/xbase: mi

Log Message:
Add entries for fonts.conf.{0,5,html}

Finishes PR xsrc/49777


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/distrib/sets/lists/xbase/mi

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

Modified files:

Index: src/distrib/sets/lists/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.131 src/distrib/sets/lists/xbase/mi:1.132
--- src/distrib/sets/lists/xbase/mi:1.131	Mon May 16 22:20:10 2016
+++ src/distrib/sets/lists/xbase/mi	Tue May 31 02:37:15 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.131 2016/05/16 22:20:10 christos Exp $
+# $NetBSD: mi,v 1.132 2016/05/31 02:37:15 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2715,6 +2715,7 @@
 ./usr/X11R7/man/cat4/x86	base-x11-root	xorg
 ./usr/X11R7/man/cat5	base-x11-root	xorg
 ./usr/X11R7/man/cat5/fonts-conf.0			-unknown-	.cat,xorg
+./usr/X11R7/man/cat5/fonts.conf.0			-unknown-	.cat,xorg
 ./usr/X11R7/man/cat7	base-x11-root	xorg
 ./usr/X11R7/man/cat7/Consortium.0			-unknown-	.cat,xorg
 ./usr/X11R7/man/cat7/Standards.0			-unknown-	.cat,xorg
@@ -2857,6 +2858,7 @@
 ./usr/X11R7/man/html4/x86	base-x11-root	xorg
 ./usr/X11R7/man/html5	base-x11-root	xorg
 ./usr/X11R7/man/html5/fonts-conf.html			-unknown-	html,xorg
+./usr/X11R7/man/html5/fonts.conf.html			-unknown-	html,xorg
 ./usr/X11R7/man/html7	base-x11-root	xorg
 ./usr/X11R7/man/html7/Consortium.html			-unknown-	html,xorg
 ./usr/X11R7/man/html7/Standards.html			-unknown-	html,xorg
@@ -3000,6 +3002,7 @@
 ./usr/X11R7/man/man4/x86	base-x11-root	xorg
 ./usr/X11R7/man/man5	base-x11-root	xorg
 ./usr/X11R7/man/man5/fonts-conf.5			-unknown-	.man,xorg
+./usr/X11R7/man/man5/fonts.conf.5			-unknown-	.man,xorg
 ./usr/X11R7/man/man7	base-x11-root	xorg
 ./usr/X11R7/man/man7/Consortium.7			-unknown-	.man,xorg
 ./usr/X11R7/man/man7/Standards.7			-unknown-	.man,xorg



CVS commit: src/external/mit/xorg/lib/fontconfig/src

2016-05-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 31 02:35:49 UTC 2016

Modified Files:
src/external/mit/xorg/lib/fontconfig/src: Makefile

Log Message:
Install man-link from fonts-conf.5 --> fonts.conf.5 to deal with an
erroneous cross-ref in xclock's man-page.  suggested by wiz@.

Fixes PR xsrc/49777


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/mit/xorg/lib/fontconfig/src/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/fontconfig/src/Makefile
diff -u src/external/mit/xorg/lib/fontconfig/src/Makefile:1.17 src/external/mit/xorg/lib/fontconfig/src/Makefile:1.18
--- src/external/mit/xorg/lib/fontconfig/src/Makefile:1.17	Wed Jul 16 14:05:04 2014
+++ src/external/mit/xorg/lib/fontconfig/src/Makefile	Tue May 31 02:35:49 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2014/07/16 14:05:04 nakayama Exp $
+#	$NetBSD: Makefile,v 1.18 2016/05/31 02:35:49 pgoyette Exp $
 
 .include 
 
@@ -90,6 +90,8 @@ MAN=	FcAtomicCreate.3 FcAtomicDeleteNew.
 
 MAN+=	fonts-conf.5
 
+MLINKS= fonts-conf.5 fonts.conf.5
+
 LIBDPLIBS=\
 	expat		${NETBSDSRCDIR}/external/mit/expat/lib/libexpat \
 	freetype	${.CURDIR}/../../freetype



CVS commit: src/sbin/gpt

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 02:29:54 UTC 2016

Modified Files:
src/sbin/gpt: show.c

Log Message:
PR 50756 David Binderman: avoid running off the end of an array in case
thing we're looking for isn't there. Which is probably impossible, but
that's not obvious.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/gpt/show.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/gpt/show.c
diff -u src/sbin/gpt/show.c:1.35 src/sbin/gpt/show.c:1.36
--- src/sbin/gpt/show.c:1.35	Tue Dec 29 16:45:04 2015
+++ src/sbin/gpt/show.c	Tue May 31 02:29:54 2016
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: show.c,v 1.35 2015/12/29 16:45:04 christos Exp $");
+__RCSID("$NetBSD: show.c,v 1.36 2016/05/31 02:29:54 dholland Exp $");
 #endif
 
 #include 
@@ -114,7 +114,12 @@ print_part_type(int map_type, int flags,
 			if (map_start == p->map_start + start)
 break;
 		}
-		printf("%d", mbr->mbr_part[i].part_typ);
+		if (i == 4) {
+			/* wasn't there */
+			printf("[partition not found?]");
+		} else {
+			printf("%d", mbr->mbr_part[i].part_typ);
+		}
 		break;
 	case MAP_TYPE_GPT_PART:
 		printf("GPT part ");



CVS commit: src/sys/arch/arm/omap

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 02:26:00 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2430_intr.c

Log Message:
PR 50755 David Binderman: assert about table entries only when they exist.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/omap2430_intr.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/arm/omap/omap2430_intr.c
diff -u src/sys/arch/arm/omap/omap2430_intr.c:1.6 src/sys/arch/arm/omap/omap2430_intr.c:1.7
--- src/sys/arch/arm/omap/omap2430_intr.c:1.6	Fri Jul  1 20:30:21 2011
+++ src/sys/arch/arm/omap/omap2430_intr.c	Tue May 31 02:26:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2430_intr.c,v 1.6 2011/07/01 20:30:21 dyoung Exp $	*/
+/*	$NetBSD: omap2430_intr.c,v 1.7 2016/05/31 02:26:00 dholland Exp $	*/
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
  * interrupt header.
@@ -35,7 +35,7 @@
 #include "opt_omap.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2430_intr.c,v 1.6 2011/07/01 20:30:21 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2430_intr.c,v 1.7 2016/05/31 02:26:00 dholland Exp $");
 
 #include 
 #include 
@@ -455,7 +455,9 @@ deliver_irqs(register_t psw, int ipl, vo
 	KASSERT((intrgroups[4].ig_pending_irqs & intrgroups[4].ig_irqsbyipl[ipl]) == 0);
 	KASSERT((intrgroups[5].ig_pending_irqs & intrgroups[5].ig_irqsbyipl[ipl]) == 0);
 	KASSERT((intrgroups[6].ig_pending_irqs & intrgroups[6].ig_irqsbyipl[ipl]) == 0);
+#ifdef OMAP_2430
 	KASSERT((intrgroups[7].ig_pending_irqs & intrgroups[7].ig_irqsbyipl[ipl]) == 0);
+#endif
 	if (frame == NULL)
 		last_delivered_ipl = saved_ipl;
 }



CVS commit: src/sys/arch/macppc/dev

2016-05-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May 31 02:17:18 UTC 2016

Modified Files:
src/sys/arch/macppc/dev: pmu.c

Log Message:
make sure we call sysmon_pswitch_event() from thread context


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/macppc/dev/pmu.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/macppc/dev/pmu.c
diff -u src/sys/arch/macppc/dev/pmu.c:1.24 src/sys/arch/macppc/dev/pmu.c:1.25
--- src/sys/arch/macppc/dev/pmu.c:1.24	Sun Feb 14 19:54:20 2016
+++ src/sys/arch/macppc/dev/pmu.c	Tue May 31 02:17:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmu.c,v 1.24 2016/02/14 19:54:20 chs Exp $ */
+/*	$NetBSD: pmu.c,v 1.25 2016/05/31 02:17:18 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.24 2016/02/14 19:54:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.25 2016/05/31 02:17:18 macallan Exp $");
 
 #include 
 #include 
@@ -90,6 +90,7 @@ struct pmu_softc {
 	int sc_brightness, sc_brightness_wanted;
 	int sc_volume, sc_volume_wanted;
 	int sc_lid_closed;
+	int sc_pswitch_pending;
 	/* deferred processing */
 	lwp_t *sc_thread;
 	/* signalling the event thread */
@@ -285,6 +286,7 @@ pmu_attach(device_t parent, device_t sel
 	sc->sc_flags = 0;
 	sc->sc_callback = NULL;
 	sc->sc_lid_closed = 0;
+	sc->sc_pswitch_pending = 0;
 
 	if (bus_space_map(sc->sc_memt, ca->ca_reg[0] + ca->ca_baseaddr,
 	ca->ca_reg[1], 0, &sc->sc_memh) != 0) {
@@ -658,9 +660,8 @@ pmu_intr(void *arg)
 		closed = (resp[2] & PMU_ENV_LID_CLOSED) != 0;
 		if (closed != sc->sc_lid_closed) {
 			sc->sc_lid_closed = closed;
-			sysmon_pswitch_event(&sc->sc_lidswitch, 
-			closed ? PSWITCH_EVENT_PRESSED : 
-			PSWITCH_EVENT_RELEASED);
+			sc->sc_pswitch_pending = 1;
+			wakeup(&sc->sc_event);
 		}
 		goto done;
 	}
@@ -1023,6 +1024,13 @@ pmu_thread(void *cookie)
 			sc->sc_volume = sc->sc_volume_wanted;
 		}
 
+		if (sc->sc_pswitch_pending) {
+			sc->sc_pswitch_pending = 1;
+			sysmon_pswitch_event(&sc->sc_lidswitch, 
+			sc->sc_lid_closed ? PSWITCH_EVENT_PRESSED : 
+			PSWITCH_EVENT_RELEASED);
+		}
+
 		if (sc->sc_callback != NULL)
 			sc->sc_callback(sc->sc_cb_cookie);
 	}



CVS commit: othersrc/external/bsd/luhn/bin

2016-05-30 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 31 02:10:00 UTC 2016

Added Files:
othersrc/external/bsd/luhn/bin: 1.expected Testspec

Log Message:
Add test for luhn library and utility, derived from the existing tests in the
Makefile using human2atf. Not very extensive, but gives a basic functionality
check. Results of running the tests:

[19:06:50] agc@netbsd-002 ...tests/usr.bin/luhn [3437] > sudo make test
*** WARNING: make test is experimental
***
*** Using this test does not preclude you from running the tests
*** installed in /usr/tests.  This test run may raise false
*** positives and/or false negatives.

Tests root: /usr/tests/usr.bin/luhn

t_luhn (1/1): 1 test cases
luhn_testset_1_basic: [0.030007s] Passed.
[0.030780s]

Summary for 1 test programs:
1 passed test cases.
0 failed test cases.
0 expected failed test cases.
0 skipped test cases.

*** The verbatim output of atf-run has been saved to 
/usr/tests/usr.bin/luhn/atf-run.log
*** Once again, note that make test is unsupported.
[19:06:54] agc@netbsd-002 ...tests/usr.bin/luhn [3438]


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/luhn/bin/1.expected \
othersrc/external/bsd/luhn/bin/Testspec

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

Added files:

Index: othersrc/external/bsd/luhn/bin/1.expected
diff -u /dev/null othersrc/external/bsd/luhn/bin/1.expected:1.1
--- /dev/null	Tue May 31 02:10:00 2016
+++ othersrc/external/bsd/luhn/bin/1.expected	Tue May 31 02:10:00 2016
@@ -0,0 +1,4 @@
+number '7992739871', checkdigit 3
+number '7992739871', checkdigit 3
+number '7992739871', checkdigit 3
+number '7992739871', checkdigit 3
Index: othersrc/external/bsd/luhn/bin/Testspec
diff -u /dev/null othersrc/external/bsd/luhn/bin/Testspec:1.1
--- /dev/null	Tue May 31 02:10:00 2016
+++ othersrc/external/bsd/luhn/bin/Testspec	Tue May 31 02:10:00 2016
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+# $NetBSD: Testspec,v 1.1 2016/05/31 02:10:00 agc Exp $
+
+# Copyright (c) 2016 Alistair Crooks 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+TESTNAME=luhn
+
+TESTSET_1_NAME=basic
+TESTSET_1_FILES='
+1.expected
+'
+TESTSET_1_CASE_1="-s eq:0 -o file:1.expected -e empty luhn 7992739871 7992739871"



CVS commit: othersrc/external/bsd/delta/bin

2016-05-30 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 31 01:59:47 UTC 2016

Added Files:
othersrc/external/bsd/delta/bin: Testspec

Log Message:
Convert the tests in the Makefile to atf, by means of human2atf, and add
the resulting Testspec file. Results of running atf checks:

[18:57:43] agc@netbsd-002 ...tests/usr.bin/delta [3390] > sudo make test
*** WARNING: make test is experimental
***
*** Using this test does not preclude you from running the tests
*** installed in /usr/tests.  This test run may raise false
*** positives and/or false negatives.

Tests root: /usr/tests/usr.bin/delta

t_delta (1/1): 3 test cases
delta_testset_1_basics: [0.027398s] Passed.
delta_testset_2_backwards: [0.029421s] Passed.
delta_testset_3_more_extensive_changes: [0.027521s] Passed.
[0.089274s]

Summary for 1 test programs:
3 passed test cases.
0 failed test cases.
0 expected failed test cases.
0 skipped test cases.

*** The verbatim output of atf-run has been saved to 
/usr/tests/usr.bin/delta/atf-run.log
*** Once again, note that make test is unsupported.
[18:57:46] agc@netbsd-002 ...tests/usr.bin/delta [3391] >


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/delta/bin/Testspec

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

Added files:

Index: othersrc/external/bsd/delta/bin/Testspec
diff -u /dev/null othersrc/external/bsd/delta/bin/Testspec:1.1
--- /dev/null	Tue May 31 01:59:47 2016
+++ othersrc/external/bsd/delta/bin/Testspec	Tue May 31 01:59:47 2016
@@ -0,0 +1,60 @@
+#! /bin/sh
+
+# $NetBSD: Testspec,v 1.1 2016/05/31 01:59:47 agc Exp $
+
+# Copyright (c) 2016 Alistair Crooks 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+TESTNAME=delta
+
+# basic tests
+TESTSET_1_NAME=basics
+TESTSET_1_FILES='
+1
+2
+'
+TESTSET_1_CASE_1="-s eq:0 -o empty -e empty delta -d 1 2 2.diff"
+TESTSET_1_CASE_2="-s eq:0 -o empty -e empty delta -p 1 2.new 2.diff"
+TESTSET_1_CASE_3="-s eq:0 -o file:2 -e empty cat 2.new"
+
+# same test backwards
+TESTSET_2_NAME=backwards
+TESTSET_2_FILES='
+1
+2
+'
+TESTSET_2_CASE_1="-s eq:0 -o empty -e empty delta -d 2 1 2.diff"
+TESTSET_2_CASE_2="-s eq:0 -o empty -e empty delta -p 2 1.new 2.diff"
+TESTSET_2_CASE_3="-s eq:0 -o file:1 -e empty cat 1.new"
+
+# more extensive changes
+TESTSET_3_NAME=more_extensive_changes
+TESTSET_3_FILES='
+3
+4
+'
+TESTSET_3_CASE_1="-s eq:0 -o empty -e empty delta -d 4 3 4.diff"
+TESTSET_3_CASE_2="-s eq:0 -o empty -e empty delta -p 4 3.new 4.diff"
+TESTSET_3_CASE_3="-s eq:0 -o file:3 -e empty cat 3.new"
+



CVS commit: src/sys/arch/i386/i386

2016-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 30 22:58:52 UTC 2016

Modified Files:
src/sys/arch/i386/i386: cpu_in_cksum.S

Log Message:
Handle PIC linking for tests


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/i386/cpu_in_cksum.S

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/i386/i386/cpu_in_cksum.S
diff -u src/sys/arch/i386/i386/cpu_in_cksum.S:1.4 src/sys/arch/i386/i386/cpu_in_cksum.S:1.5
--- src/sys/arch/i386/i386/cpu_in_cksum.S:1.4	Mon Apr 28 16:23:24 2008
+++ src/sys/arch/i386/i386/cpu_in_cksum.S	Mon May 30 18:58:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.4 2008/04/28 20:23:24 martin Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.5 2016/05/30 22:58:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.4 2008/04/28 20:23:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.5 2016/05/30 22:58:52 christos Exp $");
 
 #include "assym.h"
 
@@ -330,7 +330,7 @@ ENTRY(cpu_in_cksum)
 
 .Lout_of_mbufs:
 	pushl	$1f
-	call	_C_LABEL(printf)
+	call	PIC_PLT(_C_LABEL(printf))
 	leal	4(%esp), %esp
 	jmp	.Lreturn
 1:



CVS commit: src/sbin/iscsid

2016-05-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 30 22:02:41 UTC 2016

Modified Files:
src/sbin/iscsid: iscsid_globals.h

Log Message:
Add printf-like annotation.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/iscsid/iscsid_globals.h

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

Modified files:

Index: src/sbin/iscsid/iscsid_globals.h
diff -u src/sbin/iscsid/iscsid_globals.h:1.8 src/sbin/iscsid/iscsid_globals.h:1.9
--- src/sbin/iscsid/iscsid_globals.h:1.8	Sun May 29 13:35:45 2016
+++ src/sbin/iscsid/iscsid_globals.h	Mon May 30 22:02:41 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsid_globals.h,v 1.8 2016/05/29 13:35:45 mlelstv Exp $	*/
+/*	$NetBSD: iscsid_globals.h,v 1.9 2016/05/30 22:02:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -385,7 +385,7 @@ extern int debug_level;
 
 #define DEBOUT(x) iscsid_log x
 #define DEB(lev,x) { if (debug_level >= lev) iscsid_log x ; }
-void iscsid_log(const char *, ...);
+void iscsid_log(const char *, ...) __printflike(1, 2);
 
 /* Session list protection shortcuts */
 



CVS commit: src/sbin/iscsid

2016-05-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon May 30 21:58:32 UTC 2016

Modified Files:
src/sbin/iscsid: iscsid_main.c

Log Message:
mark noreturn function exit_daemon() as __dead


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sbin/iscsid/iscsid_main.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/iscsid/iscsid_main.c
diff -u src/sbin/iscsid/iscsid_main.c:1.10 src/sbin/iscsid/iscsid_main.c:1.11
--- src/sbin/iscsid/iscsid_main.c:1.10	Sun May 29 13:35:45 2016
+++ src/sbin/iscsid/iscsid_main.c	Mon May 30 21:58:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsid_main.c,v 1.10 2016/05/29 13:35:45 mlelstv Exp $	*/
+/*	$NetBSD: iscsid_main.c,v 1.11 2016/05/30 21:58:32 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -479,7 +479,7 @@ iscsid_log(const char *fmt, ...)
  *Deregister the event handler, deregister isns servers, then exit program.
  */
 
-static void
+static void __dead
 exit_daemon(void)
 {
 	LOCK_SESSIONS;



CVS commit: src/usr.sbin/makemandb

2016-05-30 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon May 30 19:35:29 UTC 2016

Modified Files:
src/usr.sbin/makemandb: stopwords.txt

Log Message:
Add 'a' to the stopwords list. Ok from christos


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makemandb/stopwords.txt

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/makemandb/stopwords.txt
diff -u src/usr.sbin/makemandb/stopwords.txt:1.3 src/usr.sbin/makemandb/stopwords.txt:1.4
--- src/usr.sbin/makemandb/stopwords.txt:1.3	Thu Mar 31 20:15:49 2016
+++ src/usr.sbin/makemandb/stopwords.txt	Mon May 30 19:35:29 2016
@@ -8,6 +8,7 @@
 7
 8
 9
+a
 a's
 able
 about



CVS commit: src/external/gpl2/xcvs/dist/src

2016-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 30 17:49:51 UTC 2016

Modified Files:
src/external/gpl2/xcvs/dist/src: import.c subr.c

Log Message:
Make sure that all messages end in '\n' in make_message_rcsvalid() and
compensate for it in add_rcs_file().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/import.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/subr.c

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

Modified files:

Index: src/external/gpl2/xcvs/dist/src/import.c
diff -u src/external/gpl2/xcvs/dist/src/import.c:1.6 src/external/gpl2/xcvs/dist/src/import.c:1.7
--- src/external/gpl2/xcvs/dist/src/import.c:1.6	Tue May 17 10:00:09 2016
+++ src/external/gpl2/xcvs/dist/src/import.c	Mon May 30 13:49:51 2016
@@ -21,7 +21,7 @@
  * Additional arguments specify more Vendor Release Tags.
  */
 #include 
-__RCSID("$NetBSD: import.c,v 1.6 2016/05/17 14:00:09 christos Exp $");
+__RCSID("$NetBSD: import.c,v 1.7 2016/05/30 17:49:51 christos Exp $");
 
 #include "cvs.h"
 #include "lstat.h"
@@ -1409,7 +1409,7 @@ add_rcs_file (const char *message, const
 	/* We are going to put the log message in the revision on the
 	   branch.  So putting it here too seems kind of redundant, I
 	   guess (and that is what CVS has always done, anyway).  */
-	if (fprintf (fprcs, "Initial revision") < 0)
+	if (fprintf (fprcs, "Initial revision\n") < 0)
 		goto write_error;
 	}
 	else
@@ -1417,7 +1417,7 @@ add_rcs_file (const char *message, const
 	if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0)
 		goto write_error;
 	}
-	if (fprintf (fprcs, "\012@\012") < 0 ||
+	if (fprintf (fprcs, "@\012") < 0 ||
 	fprintf (fprcs, "text\012@") < 0)
 	{
 	goto write_error;
@@ -1443,7 +1443,7 @@ add_rcs_file (const char *message, const
 		fprintf (fprcs, "log\012@") < 0 ||
 		expand_at_signs (message,
  (off_t) strlen (message), fprcs) < 0 ||
-		fprintf (fprcs, "\012@\012text\012") < 0 ||
+		fprintf (fprcs, "@\012text\012") < 0 ||
 		fprintf (fprcs, "@@\012") < 0)
 		goto write_error;
 	}

Index: src/external/gpl2/xcvs/dist/src/subr.c
diff -u src/external/gpl2/xcvs/dist/src/subr.c:1.3 src/external/gpl2/xcvs/dist/src/subr.c:1.4
--- src/external/gpl2/xcvs/dist/src/subr.c:1.3	Tue May 17 10:00:09 2016
+++ src/external/gpl2/xcvs/dist/src/subr.c	Mon May 30 13:49:51 2016
@@ -13,7 +13,7 @@
  * Various useful functions for the CVS support code.
  */
 #include 
-__RCSID("$NetBSD: subr.c,v 1.3 2016/05/17 14:00:09 christos Exp $");
+__RCSID("$NetBSD: subr.c,v 1.4 2016/05/30 17:49:51 christos Exp $");
 
 #include "cvs.h"
 
@@ -542,7 +542,8 @@ make_message_rcsvalid (const char *messa
 if (message == NULL) message = "";
 
 /* Strip whitespace from end of lines and end of string. */
-dp = dst = (char *) xmalloc (strlen (message) + 1);
+/* One for NUL, one for \n */
+dp = dst = xmalloc (strlen (message) + 2);
 for (mp = message; *mp != '\0'; ++mp)
 {
 	if (*mp == '\n')
@@ -564,7 +565,12 @@ make_message_rcsvalid (const char *messa
 if (*dst == '\0')
 {
 	free (dst);
-	dst = xstrdup ("*** empty log message ***");
+	dst = xstrdup ("*** empty log message ***\n");
+}
+else if (dp > dst && dp[-1] != '\n')
+{
+	*dp++ = '\n';
+	*dp++ = '\0';
 }
 
 return dst;



CVS commit: src/lib/libform

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:48:29 UTC 2016

Modified Files:
src/lib/libform: type_numeric.c

Log Message:
PR 51190 David Binderman: simplify redundant conditionals.
Also add paranoia when looping on isdigit().


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libform/type_numeric.c

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

Modified files:

Index: src/lib/libform/type_numeric.c
diff -u src/lib/libform/type_numeric.c:1.8 src/lib/libform/type_numeric.c:1.9
--- src/lib/libform/type_numeric.c:1.8	Thu Oct 28 21:14:52 2004
+++ src/lib/libform/type_numeric.c	Mon May 30 17:48:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: type_numeric.c,v 1.8 2004/10/28 21:14:52 dsl Exp $	*/
+/*	$NetBSD: type_numeric.c,v 1.9 2016/05/30 17:48:29 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998-1999 Brett Lymn
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: type_numeric.c,v 1.8 2004/10/28 21:14:52 dsl Exp $");
+__RCSID("$NetBSD: type_numeric.c,v 1.9 2016/05/30 17:48:29 dholland Exp $");
 
 #include 
 #include 
@@ -136,16 +136,15 @@ numeric_check_field(FIELD *field, char *
 		cur++;
 
 	  /* if not at end of string then check for decimal... */
-	if ((buf[cur] != '\0') && (buf[cur] == '.')) {
+	if (buf[cur] == '.') {
 		cur++;
-		  /* check for more digits now */
-		while(isdigit((unsigned char)buf[cur]))
+		/* check for more digits now */
+		while (buf[cur] && isdigit((unsigned char)buf[cur]))
 			cur++;
 	}
 	
 	  /* check for an exponent */
-	if ((buf[cur] != '\0') &&
-	((buf[cur] == 'E') || (buf[cur] == 'e'))) {
+	if ((buf[cur] == 'E') || (buf[cur] == 'e')) {
 		cur++;
 		if (buf[cur] == '\0')
 			return FALSE;



CVS commit: src/sys/arch/i386/i386

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:45:26 UTC 2016

Modified Files:
src/sys/arch/i386/i386: multiboot.c

Log Message:
PR 51187 David Binderman: simplify redundant conditional


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/i386/multiboot.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/i386/i386/multiboot.c
diff -u src/sys/arch/i386/i386/multiboot.c:1.22 src/sys/arch/i386/i386/multiboot.c:1.23
--- src/sys/arch/i386/i386/multiboot.c:1.22	Fri Dec  7 04:49:08 2012
+++ src/sys/arch/i386/i386/multiboot.c	Mon May 30 17:45:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: multiboot.c,v 1.22 2012/12/07 04:49:08 msaitoh Exp $	*/
+/*	$NetBSD: multiboot.c,v 1.23 2016/05/30 17:45:26 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.22 2012/12/07 04:49:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.23 2016/05/30 17:45:26 dholland Exp $");
 
 #include "opt_multiboot.h"
 
@@ -593,7 +593,7 @@ setup_howto(struct multiboot_info *mi)
 	/* Skip kernel file name. */
 	while (*cl != '\0' && *cl != ' ')
 		cl++;
-	while (*cl != '\0' && *cl == ' ')
+	while (*cl == ' ')
 		cl++;
 
 	/* Check if there are flags and set 'howto' accordingly. */



CVS commit: src/sys/arch/evbarm/imx7

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:43:46 UTC 2016

Modified Files:
src/sys/arch/evbarm/imx7: imx7_machdep.c

Log Message:
If MEMSIZE isn't set, #error instead of proceeding using uninitialized
stack garbage as the memory size. Please improve as needed; I don't know
anything about this hardware.

PR 51150 from David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/imx7/imx7_machdep.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/evbarm/imx7/imx7_machdep.c
diff -u src/sys/arch/evbarm/imx7/imx7_machdep.c:1.2 src/sys/arch/evbarm/imx7/imx7_machdep.c:1.3
--- src/sys/arch/evbarm/imx7/imx7_machdep.c:1.2	Thu May 19 05:15:51 2016
+++ src/sys/arch/evbarm/imx7/imx7_machdep.c	Mon May 30 17:43:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx7_machdep.c,v 1.2 2016/05/19 05:15:51 ryo Exp $	*/
+/*	$NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.2 2016/05/19 05:15:51 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -211,6 +211,12 @@ initarm(void *arg)
 
 #ifdef MEMSIZE
 	memsize = MEMSIZE * 1024 * 1024;
+#else
+/*
+ * Ugh... but this is better than proceeding using an uninitialized
+ * value in memsize, as the code did before I added this branch...
+ */
+#error "MEMSIZE not set"
 #endif
 
 	bootconfig.dramblocks = 1;



CVS commit: src/bin/pax

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:34:36 UTC 2016

Modified Files:
src/bin/pax: dumptar.c

Log Message:
Remove undefined behavior in buf(); use buf() as intended in intarg().
While here also add includes to fix the build. Retires PR 50999 from
David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/bin/pax/dumptar.c

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

Modified files:

Index: src/bin/pax/dumptar.c
diff -u src/bin/pax/dumptar.c:1.2 src/bin/pax/dumptar.c:1.3
--- src/bin/pax/dumptar.c:1.2	Mon Apr 28 20:22:51 2008
+++ src/bin/pax/dumptar.c	Mon May 30 17:34:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumptar.c,v 1.2 2008/04/28 20:22:51 martin Exp $	*/
+/*	$NetBSD: dumptar.c,v 1.3 2016/05/30 17:34:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,8 +30,12 @@
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -39,20 +43,25 @@
 
 #define ussum(a) 1
 
+/*
+ * Ensure null termination.
+ */
 static char *
 buf(const char *p, size_t s)
 {
 	static char buf[1024];
-	(void)snprintf(buf, sizeof(buf), "%s", p);
+
+	assert(s < sizeof(buf));
+	memcpy(buf, p, s);
 	buf[s] = '\0';
 	return buf;
 }
 
-int
+static int
 intarg(const char *p, size_t s)
 {
 	char *ep, *b = buf(p, s);
-	int r = (int)strtol(p, &ep, 8);
+	int r = (int)strtol(b, &ep, 8);
 	return r;
 }
 



CVS commit: src/bin/ls

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:26:29 UTC 2016

Modified Files:
src/bin/ls: ls.c

Log Message:
PR 50997 David Binderman: fix format strings


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/bin/ls/ls.c

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

Modified files:

Index: src/bin/ls/ls.c
diff -u src/bin/ls/ls.c:1.74 src/bin/ls/ls.c:1.75
--- src/bin/ls/ls.c:1.74	Wed Apr  2 10:55:47 2014
+++ src/bin/ls/ls.c	Mon May 30 17:26:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ls.c,v 1.74 2014/04/02 10:55:47 wiz Exp $	*/
+/*	$NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)ls.c	8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.74 2014/04/02 10:55:47 wiz Exp $");
+__RCSID("$NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -631,7 +631,7 @@ display(FTSENT *p, FTSENT *list)
 		if (f_humanize) {
 			d.s_block = 4; /* min buf length for humanize_number */
 		} else {
-			(void)snprintf(buf, sizeof(buf), "%llu",
+			(void)snprintf(buf, sizeof(buf), "%lld",
 			(long long)howmany(maxblock, blocksize));
 			d.s_block = strlen(buf);
 			if (f_commas) /* allow for commas before every third digit */
@@ -647,7 +647,7 @@ display(FTSENT *p, FTSENT *list)
 		if (f_humanize) {
 			d.s_size = 4; /* min buf length for humanize_number */
 		} else {
-			(void)snprintf(buf, sizeof(buf), "%llu",
+			(void)snprintf(buf, sizeof(buf), "%lld",
 			(long long)maxsize);
 			d.s_size = strlen(buf);
 			if (f_commas) /* allow for commas before every third digit */
@@ -655,9 +655,9 @@ display(FTSENT *p, FTSENT *list)
 		}
 		d.s_user = maxuser;
 		if (bcfile) {
-			(void)snprintf(buf, sizeof(buf), "%u", maxmajor);
+			(void)snprintf(buf, sizeof(buf), "%d", maxmajor);
 			d.s_major = strlen(buf);
-			(void)snprintf(buf, sizeof(buf), "%u", maxminor);
+			(void)snprintf(buf, sizeof(buf), "%d", maxminor);
 			d.s_minor = strlen(buf);
 			if (d.s_major + d.s_minor + 2 > d.s_size)
 d.s_size = d.s_major + d.s_minor + 2;



CVS commit: src/dist/pf/sbin/pfctl

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:21:07 UTC 2016

Modified Files:
src/dist/pf/sbin/pfctl: pfctl_optimize.c

Log Message:
PR 50709 David Binderman: memory leak


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/pf/sbin/pfctl/pfctl_optimize.c

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

Modified files:

Index: src/dist/pf/sbin/pfctl/pfctl_optimize.c
diff -u src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.6 src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.7
--- src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.6	Wed Jun 18 09:06:26 2008
+++ src/dist/pf/sbin/pfctl/pfctl_optimize.c	Mon May 30 17:21:07 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfctl_optimize.c,v 1.6 2008/06/18 09:06:26 yamt Exp $	*/
+/*	$NetBSD: pfctl_optimize.c,v 1.7 2016/05/30 17:21:07 dholland Exp $	*/
 /*	$OpenBSD: pfctl_optimize.c,v 1.13 2006/10/31 14:17:45 mcbride Exp $ */
 
 /*
@@ -902,6 +902,7 @@ load_feedback_profile(struct pfctl *pf, 
 		pr.nr = nr;
 		if (ioctl(pf->dev, DIOCGETRULE, &pr)) {
 			warn("DIOCGETRULES");
+			free(por);
 			return (1);
 		}
 		memcpy(&por->por_rule, &pr.rule, sizeof(por->por_rule));



CVS commit: src/sys/arch/arm/arm

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:18:38 UTC 2016

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
PR 50669 David Binderman: remove dead code


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/arch/arm/arm/cpufunc.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/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.160 src/sys/arch/arm/arm/cpufunc.c:1.161
--- src/sys/arch/arm/arm/cpufunc.c:1.160	Sat Jan 23 21:39:17 2016
+++ src/sys/arch/arm/arm/cpufunc.c	Mon May 30 17:18:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.160 2016/01/23 21:39:17 christos Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.161 2016/05/30 17:18:38 dholland Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.160 2016/01/23 21:39:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.161 2016/05/30 17:18:38 dholland Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -2330,8 +2330,7 @@ early_abort_fixup(void *arg)
 			registers[base] += offset;
 			DFC_PRINTF(("r%d=%08x\n", base, registers[base]));
 		}
-	} else if ((fault_instruction & 0x0e00) == 0x0c00)
-		return ABORT_FIXUP_FAILED;
+	}
 
 	if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) {
 



CVS commit: src/sys/arch/hpc/stand/hpcboot/arm

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:11:56 UTC 2016

Modified Files:
src/sys/arch/hpc/stand/hpcboot/arm: arm_console.cpp

Log Message:
PR 50643 David Binderman: fix conditional order


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp

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/hpc/stand/hpcboot/arm/arm_console.cpp
diff -u src/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp:1.7 src/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp:1.8
--- src/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp:1.7	Thu Jan 29 21:23:38 2009
+++ src/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp	Mon May 30 17:11:56 2016
@@ -1,4 +1,4 @@
-/* -*-C++-*-	$NetBSD: arm_console.cpp,v 1.7 2009/01/29 21:23:38 nonaka Exp $	*/
+/* -*-C++-*-	$NetBSD: arm_console.cpp,v 1.8 2016/05/30 17:11:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@ ARMConsole::print(const TCHAR *fmt, ...)
 	if (!setupMultibyteBuffer())
 		return;
 
-	for (int i = 0; _bufm[i] != '\0' && i < CONSOLE_BUFSIZE; i++) {
+	for (int i = 0; i < CONSOLE_BUFSIZE && _bufm[i] != '\0'; i++) {
 		char s = _bufm[i];
 		if (s == '\n')
 			__putc('\r');



CVS commit: src/usr.sbin/sysinst

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:03:21 UTC 2016

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Explicitly ignore errors in the hack for mucking with wedges; mark it XXX
for future attention. Other part of PR 50886 from David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/partman.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/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.12 src/usr.sbin/sysinst/partman.c:1.13
--- src/usr.sbin/sysinst/partman.c:1.12	Mon May 30 17:00:38 2016
+++ src/usr.sbin/sysinst/partman.c	Mon May 30 17:03:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.12 2016/05/30 17:00:38 dholland Exp $ */
+/*	$NetBSD: partman.c,v 1.13 2016/05/30 17:03:21 dholland Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1807,6 +1807,7 @@ pm_wedge_create(int num, pm_devs_t **pm_
 		if (! wedges[i].allocated && wedges[i].todel) {
 			hackerr = run_program(RUN_SILENT | RUN_ERROR_OK,
 "dkctl %s delwedge dk%d", wedges[num].pm->diskdev, i);
+			(void)hackerr; /* XXX */
 			wedges[i].todel = 0;
 		}
 



CVS commit: src/usr.sbin/sysinst

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 17:00:38 UTC 2016

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
#if out some unreachable code that's apparently not yet supported.
PR 50886 from David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/partman.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/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.11 src/usr.sbin/sysinst/partman.c:1.12
--- src/usr.sbin/sysinst/partman.c:1.11	Sun May 17 10:13:24 2015
+++ src/usr.sbin/sysinst/partman.c	Mon May 30 17:00:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.11 2015/05/17 10:13:24 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.12 2016/05/30 17:00:38 dholland Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -469,9 +469,11 @@ pm_raid_set_value(menudesc *m, void *arg
 		case PMR_MENU_NUMROW:
 			process_menu(MENU_ok, deconst(MSG_raid_nomultidim));
 			return 0;
+#if 0 /* notyet */
 			msg_to_show = MSG_raid_numrow_ask;
 			out_var = &(dev_ptr->numRow);
 			break;
+#endif
 		case PMR_MENU_NUMCOL:
 			msg_to_show = MSG_raid_numcol_ask;
 			out_var = &(dev_ptr->numCol);



CVS commit: src/sys/arch/arm/samsung

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 16:38:35 UTC 2016

Modified Files:
src/sys/arch/arm/samsung: exynos_dwcmmc.c

Log Message:
bus_width is not used, so don't fetch it; but do leave the logic in place
commented out so it's there if anyone wants it in the future.
PR 50594 from David Binderman.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/samsung/exynos_dwcmmc.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/arm/samsung/exynos_dwcmmc.c
diff -u src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.2 src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.3
--- src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.2	Sun Dec 27 20:49:01 2015
+++ src/sys/arch/arm/samsung/exynos_dwcmmc.c	Mon May 30 16:38:35 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_dwcmmc.c,v 1.2 2015/12/27 20:49:01 jmcneill Exp $ */
+/* $NetBSD: exynos_dwcmmc.c,v 1.3 2016/05/30 16:38:35 dholland Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.2 2015/12/27 20:49:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.3 2016/05/30 16:38:35 dholland Exp $");
 
 #include 
 #include 
@@ -84,7 +84,7 @@ exynos_dwcmmc_attach(device_t parent, de
 	char intrstr[128];
 	bus_addr_t addr;
 	bus_size_t size;
-	u_int bus_width, ciu_div, fifo_depth;
+	u_int ciu_div, fifo_depth;
 	int error;
 
 	if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
@@ -92,9 +92,9 @@ exynos_dwcmmc_attach(device_t parent, de
 		return;
 	}
 
-	if (of_getprop_uint32(phandle, "bus-width", &bus_width)) {
-		bus_width = 4;
-	}
+	//if (of_getprop_uint32(phandle, "bus-width", &bus_width)) {
+	//	bus_width = 4;
+	//}
 	if (of_getprop_uint32(phandle, "fifo-depth", &fifo_depth)) {
 		fifo_depth = 64;
 	}



CVS commit: src/usr.bin/error

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 16:35:35 UTC 2016

Modified Files:
src/usr.bin/error: filter.c

Log Message:
Use this program's Strdup() instead of strdup() so it exits on failure
instead of dumping core.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/error/filter.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.bin/error/filter.c
diff -u src/usr.bin/error/filter.c:1.17 src/usr.bin/error/filter.c:1.18
--- src/usr.bin/error/filter.c:1.17	Mon May 30 16:26:34 2016
+++ src/usr.bin/error/filter.c	Mon May 30 16:35:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: filter.c,v 1.17 2016/05/30 16:26:34 dholland Exp $	*/
+/*	$NetBSD: filter.c,v 1.18 2016/05/30 16:35:35 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)filter.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: filter.c,v 1.17 2016/05/30 16:26:34 dholland Exp $");
+__RCSID("$NetBSD: filter.c,v 1.18 2016/05/30 16:35:35 dholland Exp $");
 #endif /* not lint */
 
 #include 
@@ -111,7 +111,7 @@ getignored(const char *auxname)
 	rewind(fyle);
 	for (i=0; i < nignored &&
 	  (fgets (inbuffer, sizeof(inbuffer)-1, fyle) != NULL); i++) {
-		names_ignored[i] = strdup(inbuffer);
+		names_ignored[i] = Strdup(inbuffer);
 		(void)substitute(names_ignored[i], '\n', '\0');
 	}
 	qsort(names_ignored, nignored, sizeof *names_ignored, lexsort);



CVS commit: src/usr.bin/error

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 30 16:26:34 UTC 2016

Modified Files:
src/usr.bin/error: filter.c

Log Message:
Use rewind() instead of freopen()'ing the same file for no reason. Also,
close the file when done instead of dropping it on the floor. Obsoletes
PR 50579.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/error/filter.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.bin/error/filter.c
diff -u src/usr.bin/error/filter.c:1.16 src/usr.bin/error/filter.c:1.17
--- src/usr.bin/error/filter.c:1.16	Sun Aug  9 09:49:25 2015
+++ src/usr.bin/error/filter.c	Mon May 30 16:26:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: filter.c,v 1.16 2015/08/09 09:49:25 shm Exp $	*/
+/*	$NetBSD: filter.c,v 1.17 2016/05/30 16:26:34 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)filter.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: filter.c,v 1.16 2015/08/09 09:49:25 shm Exp $");
+__RCSID("$NetBSD: filter.c,v 1.17 2016/05/30 16:26:34 dholland Exp $");
 #endif /* not lint */
 
 #include 
@@ -108,20 +108,14 @@ getignored(const char *auxname)
 	 fgets(inbuffer, sizeof(inbuffer)-1, fyle) != NULL; nignored++)
 		continue;
 	names_ignored = Calloc(nignored+1, sizeof (char *));
-	if (freopen(filename, "r", fyle) == NULL) {
-#ifdef FULLDEBUG
-		fprintf(stderr, "%s: Failure to open \"%s\" for second read.\n",
-			processname, filename);
-#endif
-		nignored = 0;
-		return;
-	}
+	rewind(fyle);
 	for (i=0; i < nignored &&
 	  (fgets (inbuffer, sizeof(inbuffer)-1, fyle) != NULL); i++) {
 		names_ignored[i] = strdup(inbuffer);
 		(void)substitute(names_ignored[i], '\n', '\0');
 	}
 	qsort(names_ignored, nignored, sizeof *names_ignored, lexsort);
+	fclose(fyle);
 #ifdef FULLDEBUG
 	printf("Names to ignore follow.\n");
 	for (i=0; i < nignored; i++) {



CVS commit: src/sys/rump/dev/lib/librnd

2016-05-30 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon May 30 14:52:06 UTC 2016

Modified Files:
src/sys/rump/dev/lib/librnd: rnd_component.c

Log Message:
Disable PR kern/51135 hack now that the problem is supposedly
fixed (to see if tests pass).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/librnd/rnd_component.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/rump/dev/lib/librnd/rnd_component.c
diff -u src/sys/rump/dev/lib/librnd/rnd_component.c:1.4 src/sys/rump/dev/lib/librnd/rnd_component.c:1.5
--- src/sys/rump/dev/lib/librnd/rnd_component.c:1.4	Mon May 16 16:31:07 2016
+++ src/sys/rump/dev/lib/librnd/rnd_component.c	Mon May 30 14:52:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd_component.c,v 1.4 2016/05/16 16:31:07 pooka Exp $	*/
+/*	$NetBSD: rnd_component.c,v 1.5 2016/05/30 14:52:06 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rnd_component.c,v 1.4 2016/05/16 16:31:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rnd_component.c,v 1.5 2016/05/30 14:52:06 pooka Exp $");
 
 #include 
 #include 
@@ -64,6 +64,7 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV)
 	rnd_init();
 }
 
+#if 0
 /*
  * XXX: the following hack works around PR kern/51135 and should ASAP be
  * nuked to and then from orbit.
@@ -90,3 +91,4 @@ RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT)
 			panic("rnd_system_ioctl failed"); /* XXX */
 	}
 }
+#endif



CVS commit: src/sys/arch/powerpc/oea

2016-05-30 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon May 30 13:04:24 UTC 2016

Modified Files:
src/sys/arch/powerpc/oea: oea_machdep.c

Log Message:
allocate cpuset structures needed by MP DDB.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/powerpc/oea/oea_machdep.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/powerpc/oea/oea_machdep.c
diff -u src/sys/arch/powerpc/oea/oea_machdep.c:1.72 src/sys/arch/powerpc/oea/oea_machdep.c:1.73
--- src/sys/arch/powerpc/oea/oea_machdep.c:1.72	Mon Jul  6 05:20:50 2015
+++ src/sys/arch/powerpc/oea/oea_machdep.c	Mon May 30 13:04:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: oea_machdep.c,v 1.72 2015/07/06 05:20:50 matt Exp $	*/
+/*	$NetBSD: oea_machdep.c,v 1.73 2016/05/30 13:04:24 chs Exp $	*/
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.72 2015/07/06 05:20:50 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.73 2016/05/30 13:04:24 chs Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -1004,6 +1004,16 @@ oea_startup(const char *model)
 
 	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
 	printf("avail memory = %s\n", pbuf);
+
+#ifdef MULTIPROCESSOR
+	kcpuset_create(&cpuset_info.cpus_running, true);
+	kcpuset_create(&cpuset_info.cpus_hatched, true);
+	kcpuset_create(&cpuset_info.cpus_paused, true);
+	kcpuset_create(&cpuset_info.cpus_resumed, true);
+	kcpuset_create(&cpuset_info.cpus_halted, true);
+
+	kcpuset_set(cpuset_info.cpus_running, cpu_number());
+#endif
 }
 
 /*



CVS commit: src/sys/kern

2016-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 30 11:24:40 UTC 2016

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

Log Message:
David Binderman in PR kern/51189: simplify loop conditions


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_optstr.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/subr_optstr.c
diff -u src/sys/kern/subr_optstr.c:1.5 src/sys/kern/subr_optstr.c:1.6
--- src/sys/kern/subr_optstr.c:1.5	Mon Apr 28 20:24:04 2008
+++ src/sys/kern/subr_optstr.c	Mon May 30 11:24:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_optstr.c,v 1.5 2008/04/28 20:24:04 martin Exp $	*/
+/*	$NetBSD: subr_optstr.c,v 1.6 2016/05/30 11:24:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_optstr.c,v 1.5 2008/04/28 20:24:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_optstr.c,v 1.6 2016/05/30 11:24:40 martin Exp $");
 
 #include 
 #include 
@@ -51,7 +51,7 @@ optstr_get(const char *optstr, const cha
 	found = false;
 
 	/* Skip any initial spaces until we find a word. */
-	while (*optstr == ' ' && *optstr != '\0')
+	while (*optstr == ' ')
 		optstr++;
 
 	/* Search for the given key within the option string. */
@@ -73,7 +73,7 @@ optstr_get(const char *optstr, const cha
 optstr++;
 
 			/* And now skip until next word. */
-			while (*optstr == ' ' && *optstr != '\0')
+			while (*optstr == ' ')
 optstr++;
 		}
 	}



CVS commit: src/sys/arch/sparc/stand/ofwboot

2016-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 30 10:37:14 UTC 2016

Modified Files:
src/sys/arch/sparc/stand/ofwboot: boot.c

Log Message:
David Binderman in PR port-sparc/51188: simplify while condition


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc/stand/ofwboot/boot.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/sparc/stand/ofwboot/boot.c
diff -u src/sys/arch/sparc/stand/ofwboot/boot.c:1.31 src/sys/arch/sparc/stand/ofwboot/boot.c:1.32
--- src/sys/arch/sparc/stand/ofwboot/boot.c:1.31	Sat Jun 28 09:16:18 2014
+++ src/sys/arch/sparc/stand/ofwboot/boot.c	Mon May 30 10:37:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.31 2014/06/28 09:16:18 rtr Exp $	*/
+/*	$NetBSD: boot.c,v 1.32 2016/05/30 10:37:14 martin Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999 Eduardo E. Horvath.  All rights reserved.
@@ -141,7 +141,7 @@ bootoptions(const char *ap, char *loadde
 		}
 		end1 = ap;
 
-		while (*ap != '\0' && *ap == ' ') {
+		while (*ap == ' ') {
 			ap++;
 		}
 



CVS commit: src/sys/external/bsd/sljit/dist/sljit_src

2016-05-30 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Mon May 30 09:34:39 UTC 2016

Modified Files:
src/sys/external/bsd/sljit/dist/sljit_src: sljitNativePPC_common.c

Log Message:
Reduce diff with mainstream.

In the new sljt version, ppc_cache_flush() is guarded by
SLJIT_CACHE_FLUSH_OWN_IMPL. We can keep is as long as we
don't define SLJIT_CACHE_FLUSH_OWN_IMPL.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.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/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.c
diff -u src/sys/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.c:1.6 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.c:1.7
--- src/sys/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.c:1.6	Sun May 29 17:17:48 2016
+++ src/sys/external/bsd/sljit/dist/sljit_src/sljitNativePPC_common.c	Mon May 30 09:34:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitNativePPC_common.c,v 1.6 2016/05/29 17:17:48 alnsn Exp $	*/
+/*	$NetBSD: sljitNativePPC_common.c,v 1.7 2016/05/30 09:34:39 alnsn Exp $	*/
 
 /*
  *Stack-less Just-In-Time compiler
@@ -48,6 +48,51 @@ typedef sljit_u32 sljit_ins;
 #define SLJIT_PASS_ENTRY_ADDR_TO_CALL 1
 #endif
 
+#if (defined SLJIT_CACHE_FLUSH_OWN_IMPL && SLJIT_CACHE_FLUSH_OWN_IMPL)
+
+static void ppc_cache_flush(sljit_ins *from, sljit_ins *to)
+{
+#ifdef _AIX
+	_sync_cache_range((caddr_t)from, (int)((size_t)to - (size_t)from));
+#elif defined(__GNUC__) || (defined(__IBM_GCC_ASM) && __IBM_GCC_ASM)
+#	if defined(_ARCH_PWR) || defined(_ARCH_PWR2)
+	/* Cache flush for POWER architecture. */
+	while (from < to) {
+		__asm__ volatile (
+			"clf 0, %0\n"
+			"dcs\n"
+			: : "r"(from)
+		);
+		from++;
+	}
+	__asm__ volatile ( "ics" );
+#	elif defined(_ARCH_COM) && !defined(_ARCH_PPC)
+#	error "Cache flush is not implemented for PowerPC/POWER common mode."
+#	else
+	/* Cache flush for PowerPC architecture. */
+	while (from < to) {
+		__asm__ volatile (
+			"dcbf 0, %0\n"
+			"sync\n"
+			"icbi 0, %0\n"
+			: : "r"(from)
+		);
+		from++;
+	}
+	__asm__ volatile ( "isync" );
+#	endif
+#	ifdef __xlc__
+#	warning "This file may fail to compile if -qfuncsect is used"
+#	endif
+#elif defined(__xlc__)
+#error "Please enable GCC syntax for inline assembly statements with -qasm=gcc"
+#else
+#error "This platform requires a cache flush implementation."
+#endif /* _AIX */
+}
+
+#endif /* (defined SLJIT_CACHE_FLUSH_OWN_IMPL && SLJIT_CACHE_FLUSH_OWN_IMPL) */
+
 #define TMP_REG1	(SLJIT_NUMBER_OF_REGISTERS + 2)
 #define TMP_REG2	(SLJIT_NUMBER_OF_REGISTERS + 3)
 #define TMP_REG3	(SLJIT_NUMBER_OF_REGISTERS + 4)



CVS commit: src/sys/arch/sparc/include

2016-05-30 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon May 30 09:05:32 UTC 2016

Modified Files:
src/sys/arch/sparc/include: sljit_machdep.h

Log Message:
Adapt to new sljit.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/include/sljit_machdep.h

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/sparc/include/sljit_machdep.h
diff -u src/sys/arch/sparc/include/sljit_machdep.h:1.1 src/sys/arch/sparc/include/sljit_machdep.h:1.2
--- src/sys/arch/sparc/include/sljit_machdep.h:1.1	Wed Jul 23 18:19:45 2014
+++ src/sys/arch/sparc/include/sljit_machdep.h	Mon May 30 09:05:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljit_machdep.h,v 1.1 2014/07/23 18:19:45 alnsn Exp $	*/
+/*	$NetBSD: sljit_machdep.h,v 1.2 2016/05/30 09:05:32 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 2012-2013 The NetBSD Foundation, Inc.
@@ -35,5 +35,6 @@
 
 #define SLJIT_CACHE_FLUSH(from, to) \
 	sparc_cache_flush((sljit_ins *)(from), (sljit_ins *)(to))
+#define SLJIT_CACHE_FLUSH_OWN_IMPL 1
 
 #endif