CVS commit: src/external/cddl/osnet/dev/fbt/x86

2021-08-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 18 11:26:17 UTC 2021

Modified Files:
src/external/cddl/osnet/dev/fbt/x86: fbt_isa.c

Log Message:
PR/56355: Exclude the symbol trap, not all symbols other than trap.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.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/cddl/osnet/dev/fbt/x86/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.5 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.6
--- src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.5	Sun Aug 15 16:33:57 2021
+++ src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c	Wed Aug 18 11:26:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.5 2021/08/15 16:33:57 christos Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.6 2021/08/18 11:26:17 riastradh Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -251,7 +251,7 @@ fbt_provide_module_cb(const char *name, 
 	/*
 	 * Exclude some more symbols which can be called from probe context.
 	 */
-	if (strcmp(name, "trap") ||
+	if (strcmp(name, "trap") == 0 ||
 	strcmp(name, "x86_curcpu") == 0 ||
 	strcmp(name, "x86_curlwp") == 0) {
 		return 0;



CVS commit: src/sys/modules/sodium

2021-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 18 09:34:45 UTC 2021

Modified Files:
src/sys/modules/sodium: Makefile.sodmod

Log Message:
Don't define HAVE_TI_MODE if we don't have it.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/sodium/Makefile.sodmod

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

Modified files:

Index: src/sys/modules/sodium/Makefile.sodmod
diff -u src/sys/modules/sodium/Makefile.sodmod:1.1 src/sys/modules/sodium/Makefile.sodmod:1.2
--- src/sys/modules/sodium/Makefile.sodmod:1.1	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile.sodmod	Wed Aug 18 05:34:45 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.sodmod,v 1.1 2021/08/17 17:29:20 christos Exp $
+#	$NetBSD: Makefile.sodmod,v 1.2 2021/08/18 09:34:45 christos Exp $
 
 SODIUMDIR=	${S}/external/isc/libsodium
 SODIUMSRCDIR=	${SODIUMDIR}/dist/src/libsodium
@@ -49,5 +49,8 @@ CWARNFLAGS+=	-Wno-shadow
 CWARNFLAGS+=	-Wno-unused-function
 CWARNFLAGS+=	-Wno-unused-variable
 
-CPPFLAGS+=	-DHAVE_TI_MODE -I${SODIUMDIR}/include 
+.if ${MACHINE_CPU} == "x86_64"
+CPPFLAGS+=	-DHAVE_TI_MODE
+.endif
+CPPFLAGS+=	-I${SODIUMDIR}/include 
 CPPFLAGS+=	-I${SODIUMDIR}/dist/src/libsodium/include/sodium



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

2021-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 18 09:18:09 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
 It's time to add ixg(4) and ixv(4).


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/evbarm/conf/GENERIC64

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/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.179 src/sys/arch/evbarm/conf/GENERIC64:1.180
--- src/sys/arch/evbarm/conf/GENERIC64:1.179	Sat Jun 26 09:29:14 2021
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Aug 18 09:18:09 2021
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.179 2021/06/26 09:29:14 nia Exp $
+#	$NetBSD: GENERIC64,v 1.180 2021/08/18 09:18:09 msaitoh Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -252,6 +252,8 @@ genet*		at fdt?
 #scx*		at fdt?
 aq*		at pci? dev ? function ?	# Aquantia AQC 10 gigabit
 ena*		at pci? dev ? function ?	# Amazon.com Elastic Network Adapter
+ixg*	at pci? dev ? function ?	# Intel 8259x 10 gigabit
+ixv*	at pci? dev ? function ?	# Intel 8259x 10G virtual function
 mcx*		at pci? dev ? function ?	# Mellanox 5th generation Ethernet
 mskc*		at pci? dev ? function ?	# Marvell Yukon 2 Gigabit Ethernet
 msk*		at mskc?



CVS commit: src/sys/dev/pci/ixgbe

2021-08-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 18 09:17:17 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Refresh unrefreshed descriptors' buffers correctly.

- Update next_to_refresh at least before ixgbe_rx_unrefresed() to detect
  the unrefreshed status correctly in ixgbe_rxeof().
- next_to_refresh points to the previous entry of the first unrefreshed
  descriptor, so fix a loop variable to point to the correct one in
  ixgbe_refresh_mbufs().
- Without the above two fixes, RX ring may have some unrefreshed entries
  which have inconsistent state. On such state, "ifconfig down up" causes
  panic in bus_dmamap_sync() on aarch64.
- Tested on amd64 and aarch64. OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/ixgbe/ix_txrx.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/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.81 src/sys/dev/pci/ixgbe/ix_txrx.c:1.82
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.81	Wed Jul  7 08:58:19 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Aug 18 09:17:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.81 2021/07/07 08:58:19 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.82 2021/08/18 09:17:17 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.81 2021/07/07 08:58:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.82 2021/08/18 09:17:17 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1336,15 +1336,15 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 	struct adapter  *adapter = rxr->adapter;
 	struct ixgbe_rx_buf *rxbuf;
 	struct mbuf *mp;
-	int i, j, error;
+	int i, error;
 	boolrefreshed = false;
 
-	i = j = rxr->next_to_refresh;
-	/* Control the loop with one beyond */
-	if (++j == rxr->num_desc)
-		j = 0;
+	i = rxr->next_to_refresh;
+	/* next_to_refresh points to the previous one */
+	if (++i == rxr->num_desc)
+		i = 0;
 
-	while (j != limit) {
+	while (i != limit) {
 		rxbuf = >rx_buffers[i];
 		if (rxbuf->buf == NULL) {
 			mp = ixgbe_getjcl(>jcl_head, M_NOWAIT,
@@ -1387,11 +1387,10 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 		}
 
 		refreshed = true;
-		/* Next is precalculated */
-		i = j;
+		/* next_to_refresh points to the previous one */
 		rxr->next_to_refresh = i;
-		if (++j == rxr->num_desc)
-			j = 0;
+		if (++i == rxr->num_desc)
+			i = 0;
 	}
 
 update:
@@ -2090,6 +2089,7 @@ next_desc:
 		/* Advance our pointers to the next descriptor. */
 		if (++i == rxr->num_desc)
 			i = 0;
+		rxr->next_to_check = i;
 
 		/* Now send to the stack or do LRO */
 		if (sendmp != NULL) {
@@ -2107,8 +2107,6 @@ next_desc:
 	if (ixgbe_rx_unrefreshed(rxr))
 		ixgbe_refresh_mbufs(rxr, i);
 
-	rxr->next_to_check = i;
-
 	IXGBE_RX_UNLOCK(rxr);
 
 #ifdef LRO



CVS commit: src/sys/modules

2021-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 18 09:07:07 UTC 2021

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/blake2s: Makefile
Removed Files:
src/sys/modules/blakes2s: Makefile

Log Message:
Fix broken name


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/blake2s/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/modules/blakes2s/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.253 src/sys/modules/Makefile:1.254
--- src/sys/modules/Makefile:1.253	Tue Aug 17 17:39:32 2021
+++ src/sys/modules/Makefile	Wed Aug 18 05:07:07 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.253 2021/08/17 21:39:32 kre Exp $
+#	$NetBSD: Makefile,v 1.254 2021/08/18 09:07:07 christos Exp $
 
 .include 
 
@@ -27,7 +27,7 @@ SUBDIR+=	adosfs
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs
-SUBDIR+=	blakes2s
+SUBDIR+=	blake2s
 SUBDIR+=	blowfish
 SUBDIR+=	bpf
 SUBDIR+=	bpf_filter

Added files:

Index: src/sys/modules/blake2s/Makefile
diff -u /dev/null src/sys/modules/blake2s/Makefile:1.1
--- /dev/null	Wed Aug 18 05:07:07 2021
+++ src/sys/modules/blake2s/Makefile	Wed Aug 18 05:07:07 2021
@@ -0,0 +1,13 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/18 09:07:07 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	blake2s
+
+BLAKE2SDIR=	$S/crypto/blake2
+CPPFLAGS+=	-I${BLAKE2SDIR}
+
+.PATH: ${BLAKE2SDIR}
+SRCS+=	blake2s.c
+
+.include 



CVS commit: src/usr.bin/xlint/lint1

2021-08-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 17 22:29:11 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: main1.c

Log Message:
lint: extract suppress_messages from main

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/main1.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/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.55 src/usr.bin/xlint/lint1/main1.c:1.56
--- src/usr.bin/xlint/lint1/main1.c:1.55	Tue Aug 17 21:19:02 2021
+++ src/usr.bin/xlint/lint1/main1.c	Tue Aug 17 22:29:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.55 2021/08/17 21:19:02 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.56 2021/08/17 22:29:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.55 2021/08/17 21:19:02 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.56 2021/08/17 22:29:11 rillig Exp $");
 #endif
 
 #include 
@@ -168,11 +168,28 @@ sigfpe(int s)
 	fpe = 1;
 }
 
+static void
+suppress_messages(char *ids)
+{
+	char *ptr, *end;
+	long id;
+
+	for (ptr = strtok(ids, ","); ptr != NULL; ptr = strtok(NULL, ",")) {
+		errno = 0;
+		id = strtol(ptr, , 0);
+		if ((id == TARG_LONG_MIN || id == TARG_LONG_MAX) &&
+		errno == ERANGE)
+			err(1, "invalid error message id '%s'", ptr);
+		if (*end != '\0' || ptr == end || id < 0 || id >= ERR_SETSIZE)
+			errx(1, "invalid error message id '%s'", ptr);
+		ERR_SET(id, );
+	}
+}
+
 int
 main(int argc, char *argv[])
 {
-	int	c;
-	char	*ptr;
+	int c;
 
 	setprogname(argv[0]);
 
@@ -217,23 +234,7 @@ main(int argc, char *argv[])
 			break;
 
 		case 'X':
-			for (ptr = strtok(optarg, ","); ptr != NULL;
-			ptr = strtok(NULL, ",")) {
-char *eptr;
-long msg;
-
-errno = 0;
-msg = strtol(ptr, , 0);
-if ((msg == TARG_LONG_MIN || msg == TARG_LONG_MAX) &&
-errno == ERANGE)
-err(1, "invalid error message id '%s'",
-	ptr);
-if (*eptr != '\0' || ptr == eptr || msg < 0 ||
-msg >= ERR_SETSIZE)
-	errx(1, "invalid error message id '%s'",
-	ptr);
-ERR_SET(msg, );
-			}
+			suppress_messages(optarg);
 			break;
 		default:
 			usage();



CVS commit: src

2021-08-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 17 22:00:33 UTC 2021

Modified Files:
src/share/man/man4: route.4
src/sys/altq: altq_cbq.c
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/doc: history
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c
src/sys/arch/alpha/jensenio: jensenio_dma.c
src/sys/arch/amiga/amiga: amiga_init.c
src/sys/arch/amiga/dev: fd.c grfabs_cc.c
src/sys/arch/arm/footbridge: footbridge_machdep.c
src/sys/arch/arm/imx: imxspi.c
src/sys/arch/atari/atari: atari_init.c
src/sys/arch/atari/dev: grfabs_fal.c grfabs_tt.c if_ne_mb.c
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/hpcarm/hpcarm: kloader_machdep.c pxa2x0_hpc_machdep.c
sa11x0_hpc_machdep.c
src/sys/arch/i386/conf: MODULAR
src/sys/arch/macppc/stand/ofwboot: ofdev.c
src/sys/arch/mips/alchemy/include: aureg.h
src/sys/arch/mips/ralink: ralink_eth.c
src/sys/arch/mipsco/obio: rambo.h
src/sys/arch/netwinder/netwinder: netwinder_machdep.c
src/sys/arch/pmax/ibus: siireg.h
src/sys/arch/powerpc/oea: ofw_rascons.c
src/sys/arch/sh3/include: scifreg.h
src/sys/arch/shark/shark: shark_machdep.c
src/sys/arch/sparc/sparc: machdep.c
src/sys/arch/sun2/sun2: machdep.c
src/sys/arch/sun68k/stand: README
src/sys/arch/vax/include: qdreg.h
src/sys/arch/zaurus/zaurus: kloader_machdep.c machdep.c
src/sys/dev/ic: gemreg.h hd64570.c rndisreg.h tulipreg.h
src/sys/dev/marvell: if_mvxpereg.h
src/sys/dev/pci: if_casreg.h if_iwmreg.h pci_subr.c pcireg.h
src/sys/dev/pci/ixgbe: if_bypass.c
src/sys/dev/qbus: qdreg.h
src/sys/dev/tc: stic.c
src/sys/dev/usb: usb_quirks.c xhci.c
src/sys/kern: subr_vmem.c
src/sys/lib/libkern/arch/hppa: milli.S
src/sys/netinet6: ip6_output.c ip6_var.h
src/sys/sys: shm.h
src/sys/ufs/ext2fs: ext2fs_inode.c
src/tests/net/if: t_ifconfig.sh
src/usr.sbin/acpitools/amldb: amldb.8 debug.c
src/usr.sbin/ypserv/ypinit: ypinit.sh

Log Message:
fix multiplei repetitive typos in comments, messages and documentation. mainly 
because copy paste code big amount of files are affected.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/route.4
cvs rdiff -u -r1.36 -r1.37 src/sys/altq/altq_cbq.c
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/acorn32/doc/history
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/alpha/jensenio/jensenio_dma.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/amiga/amiga/amiga_init.c
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/amiga/dev/fd.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/amiga/dev/grfabs_cc.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/footbridge/footbridge_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/imx/imxspi.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/atari/atari/atari_init.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/atari/dev/grfabs_fal.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/atari/dev/grfabs_tt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/atari/dev/if_ne_mb.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/imx31/imx31lk_machdep.c
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/evbarm/iq80310/iq80310_machdep.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbarm/iq80321/iq80321_machdep.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/lubbock/lubbock_machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/mini2440/mini2440_machdep.c

CVS commit: src/sys/modules

2021-08-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Aug 17 21:39:32 UTC 2021

Modified Files:
src/sys/modules: Makefile

Log Message:
s/blake2s/blakes2s/ to match the directory that exists


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.252 src/sys/modules/Makefile:1.253
--- src/sys/modules/Makefile:1.252	Tue Aug 17 17:29:19 2021
+++ src/sys/modules/Makefile	Tue Aug 17 21:39:32 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.252 2021/08/17 17:29:19 christos Exp $
+#	$NetBSD: Makefile,v 1.253 2021/08/17 21:39:32 kre Exp $
 
 .include 
 
@@ -27,7 +27,7 @@ SUBDIR+=	adosfs
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs
-SUBDIR+=	blake2s
+SUBDIR+=	blakes2s
 SUBDIR+=	blowfish
 SUBDIR+=	bpf
 SUBDIR+=	bpf_filter



CVS commit: src/usr.bin/xlint/lint1

2021-08-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 17 21:19:02 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: main1.c

Log Message:
lint: sync usage message with reality


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/main1.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/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.54 src/usr.bin/xlint/lint1/main1.c:1.55
--- src/usr.bin/xlint/lint1/main1.c:1.54	Tue Aug 17 21:05:34 2021
+++ src/usr.bin/xlint/lint1/main1.c	Tue Aug 17 21:19:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.54 2021/08/17 21:05:34 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.55 2021/08/17 21:19:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.54 2021/08/17 21:05:34 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.55 2021/08/17 21:19:02 rillig Exp $");
 #endif
 
 #include 
@@ -290,9 +290,9 @@ static void __attribute__((noreturn))
 usage(void)
 {
 	(void)fprintf(stderr,
-	"usage: %s [-abcdeghmprstuvwyzFST] [-Ac11] [-X [,]... "
-	"src dest\n",
-	getprogname());
+	"usage: %s [-abceghmprstuvwyzFPST] [-Ac11] [-R old=new]\n"
+	"   %*s [-X [,]...] src dest\n",
+	getprogname(), (int)strlen(getprogname()), "");
 	exit(1);
 }
 



CVS commit: src/usr.bin/xlint/lint1

2021-08-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 17 21:05:34 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: main1.c

Log Message:
lint: move GCC builtins into gcc_builtins

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/xlint/lint1/main1.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/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.53 src/usr.bin/xlint/lint1/main1.c:1.54
--- src/usr.bin/xlint/lint1/main1.c:1.53	Sun Aug  1 19:11:54 2021
+++ src/usr.bin/xlint/lint1/main1.c	Tue Aug 17 21:05:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.53 2021/08/01 19:11:54 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.54 2021/08/17 21:05:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.53 2021/08/01 19:11:54 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.54 2021/08/17 21:05:34 rillig Exp $");
 #endif
 
 #include 
@@ -130,16 +130,15 @@ sig_atomic_t fpe;
 
 static	void	usage(void);
 
-static const char builtins[] =
-"int __builtin_isinf(long double);\n"
-"int __builtin_isnan(long double);\n"
-"int __builtin_copysign(long double, long double);\n"
-;
-static const size_t builtinlen = sizeof(builtins) - 1;
-
 static FILE *
 gcc_builtins(void)
 {
+	static const char builtins[] =
+	"int __builtin_isinf(long double);\n"
+	"int __builtin_isnan(long double);\n"
+	"int __builtin_copysign(long double, long double);\n";
+	size_t builtins_len = sizeof(builtins) - 1;
+
 #if HAVE_NBTOOL_CONFIG_H
 	char template[] = "/tmp/lint.XX";
 	int fd;
@@ -151,14 +150,14 @@ gcc_builtins(void)
 		close(fd);
 		return NULL;
 	}
-	if (fwrite(builtins, 1, builtinlen, fp) != builtinlen) {
+	if (fwrite(builtins, 1, builtins_len, fp) != builtins_len) {
 		fclose(fp);
 		return NULL;
 	}
 	rewind(fp);
 	return fp;
 #else
-	return fmemopen(__UNCONST(builtins), builtinlen, "r");
+	return fmemopen(__UNCONST(builtins), builtins_len, "r");
 #endif
 }
 



CVS commit: src/distrib/sets/lists

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:31:59 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi

Log Message:
modules for if_wg, blake2s, libsodium


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.144 -r1.145 src/distrib/sets/lists/modules/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/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.9 src/distrib/sets/lists/debug/module.mi:1.10
--- src/distrib/sets/lists/debug/module.mi:1.9	Mon May 17 00:07:42 2021
+++ src/distrib/sets/lists/debug/module.mi	Tue Aug 17 13:31:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.9 2021/05/17 04:07:42 yamaguchi Exp $
+# $NetBSD: module.mi,v 1.10 2021/08/17 17:31:58 christos Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
@@ -14,6 +14,8 @@
 ./usr/libdata/debug/@MODULEDIR@/audio/audio.kmod.debug			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/autofsmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/autofs/autofs.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/blake2smodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/blake2s/blake2s.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfishmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfish/blowfish.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpfmodules-base-kernel	kmod,debug
@@ -224,6 +226,8 @@
 ./usr/libdata/debug/@MODULEDIR@/if_urndis/if_urndis.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_vlanmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_vlan/if_vlan.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_wgmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_wg/if_wg.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/iicmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/iic/iic.kmod.debug			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/ip_ecnmodules-base-kernel	kmod,debug
@@ -332,6 +336,8 @@
 ./usr/libdata/debug/@MODULEDIR@/skipjack/skipjack.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/slcompress			modules-base-kernel kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/slcompress/slcompress.kmod.debug	modules-base-kernel kmod,debug
+./usr/libdata/debug/@MODULEDIR@/sodiummodules-base-kernel kmod,solaris,debug
+./usr/libdata/debug/@MODULEDIR@/sodium/sodium.kmod.debug		modules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/solarismodules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/solaris/solaris.kmod.debug		modules-base-kernel kmod,solaris,debug
 ./usr/libdata/debug/@MODULEDIR@/spdmemmodules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.144 src/distrib/sets/lists/modules/mi:1.145
--- src/distrib/sets/lists/modules/mi:1.144	Mon May 17 00:07:42 2021
+++ src/distrib/sets/lists/modules/mi	Tue Aug 17 13:31:59 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.144 2021/05/17 04:07:42 yamaguchi Exp $
+# $NetBSD: mi,v 1.145 2021/08/17 17:31:59 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -23,6 +23,8 @@
 ./@MODULEDIR@/audio/audio.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/autofsmodules-base-kernel	kmod
 ./@MODULEDIR@/autofs/autofs.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/blake2smodules-base-kernel	kmod
+./@MODULEDIR@/blake2s/blake2s.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/blowfishmodules-base-kernel	kmod
 ./@MODULEDIR@/blowfish/blowfish.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/bpfmodules-base-kernel	kmod
@@ -251,6 +253,8 @@
 ./@MODULEDIR@/if_vioif/if_vioif.kmod		base-obsolete		obsolete
 ./@MODULEDIR@/if_vlanmodules-base-kernel	kmod
 ./@MODULEDIR@/if_vlan/if_vlan.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/if_wgmodules-base-kernel	kmod
+./@MODULEDIR@/if_wg/if_wg.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/iicmodules-base-kernel	kmod
 ./@MODULEDIR@/iic/iic.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/ip_ecnmodules-base-kernel	kmod
@@ -399,6 +403,8 @@
 ./@MODULEDIR@/slcompress/slcompress.kmod	modules-base-kernel kmod
 ./@MODULEDIR@/smbfsbase-obsolete		obsolete
 ./@MODULEDIR@/smbfs/smbfs.kmod			base-obsolete		obsolete
+./@MODULEDIR@/sodiummodules-base-kernel kmod

CVS commit: src/sys/net

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:31:13 UTC 2021

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

Log Message:
Some signnes, casts, and constant sizes.
Add module dependencies.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/net/if_wg.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_wg.c
diff -u src/sys/net/if_wg.c:1.64 src/sys/net/if_wg.c:1.65
--- src/sys/net/if_wg.c:1.64	Tue Jun 15 20:21:19 2021
+++ src/sys/net/if_wg.c	Tue Aug 17 13:31:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wg.c,v 1.64 2021/06/16 00:21:19 riastradh Exp $	*/
+/*	$NetBSD: if_wg.c,v 1.65 2021/08/17 17:31:13 christos Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki 
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.64 2021/06/16 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.65 2021/08/17 17:31:13 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq_enabled.h"
@@ -442,7 +442,7 @@ sliwin_update(struct sliwin *W, uint64_t
 	bit = S % SLIWIN_BPW;
 	if (W->B[word] & (1UL << bit))
 		return EAUTH;
-	W->B[word] |= 1UL << bit;
+	W->B[word] |= 1U << bit;
 
 	/* Accept!  */
 	return 0;
@@ -1009,7 +1009,7 @@ wg_algo_hmac(uint8_t out[], const size_t
 	uint8_t hmackey[HMAC_BLOCK_LEN] = {0};
 	uint8_t ipad[HMAC_BLOCK_LEN];
 	uint8_t opad[HMAC_BLOCK_LEN];
-	int i;
+	size_t i;
 	struct blake2s state;
 
 	KASSERT(outlen == WG_HASH_LEN);
@@ -1167,11 +1167,11 @@ wg_algo_tai64n(wg_timestamp_t timestamp)
 	/* FIXME strict TAI64N (https://cr.yp.to/libtai/tai64.html) */
 	getnanotime();
 	/* TAI64 label in external TAI64 format */
-	be32enc(timestamp, 0x4000UL + (ts.tv_sec >> 32));
+	be32enc(timestamp, 0x4000U + (uint32_t)(ts.tv_sec >> 32));
 	/* second beginning from 1970 TAI */
-	be32enc(timestamp + 4, ts.tv_sec & 0xU);
+	be32enc(timestamp + 4, (uint32_t)(ts.tv_sec & 0xU));
 	/* nanosecond in big-endian format */
-	be32enc(timestamp + 8, ts.tv_nsec);
+	be32enc(timestamp + 8, (uint32_t)ts.tv_nsec);
 }
 
 /*
@@ -1715,7 +1715,7 @@ wg_send_handshake_msg_init(struct wg_sof
 		if (wgp->wgp_handshake_start_time == 0)
 			wgp->wgp_handshake_start_time = time_uptime;
 		callout_schedule(>wgp_handshake_timeout_timer,
-		MIN(wg_rekey_timeout, INT_MAX/hz) * hz);
+		MIN(wg_rekey_timeout, (unsigned)(INT_MAX / hz)) * hz);
 	} else {
 		wg_put_session_index(wg, wgs);
 		/* Initiation failed; toss packet waiting for it if any.  */
@@ -2271,7 +2271,7 @@ wg_lookup_session_by_index(struct wg_sof
 static void
 wg_schedule_rekey_timer(struct wg_peer *wgp)
 {
-	int timeout = MIN(wg_rekey_after_time, INT_MAX/hz);
+	int timeout = MIN(wg_rekey_after_time, (unsigned)(INT_MAX / hz));
 
 	callout_schedule(>wgp_rekey_timer, timeout * hz);
 }
@@ -2308,7 +2308,7 @@ wg_need_to_send_init_message(struct wg_s
 }
 
 static void
-wg_schedule_peer_task(struct wg_peer *wgp, int task)
+wg_schedule_peer_task(struct wg_peer *wgp, unsigned int task)
 {
 
 	mutex_enter(wgp->wgp_intr_lock);
@@ -3082,7 +3082,7 @@ wg_peer_work(struct work *wk, void *cook
 {
 	struct wg_peer *wgp = container_of(wk, struct wg_peer, wgp_work);
 	struct wg_softc *wg = wgp->wgp_sc;
-	int tasks;
+	unsigned int tasks;
 
 	mutex_enter(wgp->wgp_intr_lock);
 	while ((tasks = wgp->wgp_tasks) != 0) {
@@ -4515,10 +4515,10 @@ wg_ioctl_get(struct wg_softc *wg, struct
 		const struct timespec *t = >wgp_last_handshake_time;
 
 		if (!prop_dictionary_set_uint64(prop_peer,
-			"last_handshake_time_sec", t->tv_sec))
+			"last_handshake_time_sec", (uint64_t)t->tv_sec))
 			goto next;
 		if (!prop_dictionary_set_uint32(prop_peer,
-			"last_handshake_time_nsec", t->tv_nsec))
+			"last_handshake_time_nsec", (uint32_t)t->tv_nsec))
 			goto next;
 
 		if (wgp->wgp_n_allowedips == 0)
@@ -5002,4 +5002,4 @@ rumpkern_wg_recv_peer(struct wg_softc *w
  */
 #include "if_module.h"
 
-IF_MODULE(MODULE_CLASS_DRIVER, wg, "")
+IF_MODULE(MODULE_CLASS_DRIVER, wg, "sodium,blake2s")



CVS commit: src/sys/external/isc/libsodium/src

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:30:01 UTC 2021

Modified Files:
src/sys/external/isc/libsodium/src: glue.c

Log Message:
Add module glue


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/isc/libsodium/src/glue.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/isc/libsodium/src/glue.c
diff -u src/sys/external/isc/libsodium/src/glue.c:1.1 src/sys/external/isc/libsodium/src/glue.c:1.2
--- src/sys/external/isc/libsodium/src/glue.c:1.1	Thu Aug 20 17:20:16 2020
+++ src/sys/external/isc/libsodium/src/glue.c	Tue Aug 17 13:30:01 2021
@@ -1 +1,56 @@
+/*	$NetBSD: glue.c,v 1.2 2021/08/17 17:30:01 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: glue.c,v 1.2 2021/08/17 17:30:01 christos Exp $");
+
+#include 
+#include 
+#include 
+
 int libsodium_errno;
+
+MODULE(MODULE_CLASS_MISC, sodium, NULL);
+
+static int
+sodium_modcmd(modcmd_t cmd, void *arg)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		break;
+
+	case MODULE_CMD_FINI:
+		break;
+
+	default:
+		return ENOTTY;
+	}
+
+	return 0;
+}



CVS commit: src/sys/modules

2021-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 17 17:29:20 UTC 2021

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/blakes2s: Makefile
src/sys/modules/if_wg: Makefile wg.ioconf
src/sys/modules/sodium: Makefile Makefile.sodmod

Log Message:
modules for blake2s libsodium and if_wg


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/blakes2s/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_wg/Makefile \
src/sys/modules/if_wg/wg.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/sodium/Makefile \
src/sys/modules/sodium/Makefile.sodmod

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.251 src/sys/modules/Makefile:1.252
--- src/sys/modules/Makefile:1.251	Mon Aug  9 16:49:10 2021
+++ src/sys/modules/Makefile	Tue Aug 17 13:29:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.251 2021/08/09 20:49:10 andvar Exp $
+#	$NetBSD: Makefile,v 1.252 2021/08/17 17:29:19 christos Exp $
 
 .include 
 
@@ -27,6 +27,7 @@ SUBDIR+=	adosfs
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs
+SUBDIR+=	blake2s
 SUBDIR+=	blowfish
 SUBDIR+=	bpf
 SUBDIR+=	bpf_filter
@@ -100,6 +101,7 @@ SUBDIR+=	if_ure
 SUBDIR+=	if_url
 SUBDIR+=	if_urndis
 SUBDIR+=	if_vlan
+SUBDIR+=	if_wg
 SUBDIR+=	iic
 SUBDIR+=	ip_ecn
 SUBDIR+=	ipl
@@ -389,6 +391,8 @@ SUBDIR+=	cyclic
 SUBDIR+=	dtrace
 .endif
 
+SUBDIR+=sodium
+
 # we need solaris for the dtrace and zfs modules
 .if (${MKDTRACE} != "no" || ${MKZFS} != "no")
 SUBDIR+=solaris

Added files:

Index: src/sys/modules/blakes2s/Makefile
diff -u /dev/null src/sys/modules/blakes2s/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/blakes2s/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,13 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	blake2s
+
+BLAKE2SDIR=	$S/crypto/blake2
+CPPFLAGS+=	-I${BLAKE2SDIR}
+
+.PATH: ${BLAKE2SDIR}
+SRCS+=	blake2s.c
+
+.include 

Index: src/sys/modules/if_wg/Makefile
diff -u /dev/null src/sys/modules/if_wg/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/if_wg/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		if_wg
+IOCONF=		wg.ioconf
+SRCS=		if_wg.c
+
+CPPFLAGS+=	-DINET
+CPPFLAGS+=	-DINET6
+CPPFLAGS+=	-DALTQ
+
+WARNS=		3
+
+.include 
Index: src/sys/modules/if_wg/wg.ioconf
diff -u /dev/null src/sys/modules/if_wg/wg.ioconf:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/if_wg/wg.ioconf	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,7 @@
+#	$NetBSD: wg.ioconf,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+ioconf		wg
+
+include		"conf/files"
+
+pseudo-device   wg

Index: src/sys/modules/sodium/Makefile
diff -u /dev/null src/sys/modules/sodium/Makefile:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+.include "../Makefile.inc"
+
+KMOD=	sodium
+
+.include "Makefile.sodmod"
+.include 
Index: src/sys/modules/sodium/Makefile.sodmod
diff -u /dev/null src/sys/modules/sodium/Makefile.sodmod:1.1
--- /dev/null	Tue Aug 17 13:29:20 2021
+++ src/sys/modules/sodium/Makefile.sodmod	Tue Aug 17 13:29:20 2021
@@ -0,0 +1,53 @@
+#	$NetBSD: Makefile.sodmod,v 1.1 2021/08/17 17:29:20 christos Exp $
+
+SODIUMDIR=	${S}/external/isc/libsodium
+SODIUMSRCDIR=	${SODIUMDIR}/dist/src/libsodium
+
+.PATH:	${SODIUMDIR}/src
+SRCS+=	glue.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult/curve25519/ref10
+SRCS+=	x25519_ref10.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult/curve25519
+SRCS+=	scalarmult_curve25519.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_scalarmult
+SRCS+=	crypto_scalarmult.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth/poly1305/donna
+SRCS+=	poly1305_donna.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth/poly1305
+SRCS+=	onetimeauth_poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_onetimeauth
+SRCS+=	crypto_onetimeauth.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_stream/chacha20/ref
+SRCS+=	chacha20_ref.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_stream/chacha20
+SRCS+=	stream_chacha20.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_aead/xchacha20poly1305/sodium
+SRCS+=	aead_xchacha20poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_aead/chacha20poly1305/sodium
+SRCS+=	aead_chacha20poly1305.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_core/hchacha20
+SRCS+=	core_hchacha20.c
+
+.PATH:	${SODIUMSRCDIR}/crypto_core/ed25519/ref10
+SRCS+=	ed25519_ref10.c
+
+WARNS=		3
+
+CWARNFLAGS+=	-Wall
+CWARNFLAGS+=	-Wno-shadow
+CWARNFLAGS+=	-Wno-unused-function
+CWARNFLAGS+=	-Wno-unused-variable
+
+CPPFLAGS+=	-DHAVE_TI_MODE -I${SODIUMDIR}/include 
+CPPFLAGS+=	-I${SODIUMDIR}/dist/src/libsodium/include/sodium



CVS commit: src/sys/dev/pci

2021-08-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 17 17:16:40 UTC 2021

Modified Files:
src/sys/dev/pci: pci_subr.c

Log Message:
s/Windw/Window/ in log message.


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/dev/pci/pci_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/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.227 src/sys/dev/pci/pci_subr.c:1.228
--- src/sys/dev/pci/pci_subr.c:1.227	Mon Jul 12 04:41:14 2021
+++ src/sys/dev/pci/pci_subr.c	Tue Aug 17 17:16:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.227 2021/07/12 04:41:14 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.228 2021/08/17 17:16:40 andvar Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.227 2021/07/12 04:41:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.228 2021/08/17 17:16:40 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -3539,7 +3539,7 @@ pci_conf_print_multicast_cap(const pcire
 	/* Endpoint Only */
 	n = PCIREG_SHIFTOUT(reg, PCI_MCAST_CAP_WINSIZEREQ);
 	if (n > 0)
-		printf("  Windw Size Requested: %d\n", 1 << (n - 1));
+		printf("  Window Size Requested: %d\n", 1 << (n - 1));
 
 	onoff("ECRC Regeneration Supported", reg, PCI_MCAST_CAP_ECRCREGEN);
 



CVS commit: src/share/man/man4

2021-08-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 17 14:11:22 UTC 2021

Modified Files:
src/share/man/man4: tty.4

Log Message:
tty.4: s/asynchronus/asynchronous/


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man4/tty.4

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/man4/tty.4
diff -u src/share/man/man4/tty.4:1.30 src/share/man/man4/tty.4:1.31
--- src/share/man/man4/tty.4:1.30	Sat Sep  7 19:32:52 2019
+++ src/share/man/man4/tty.4	Tue Aug 17 14:11:22 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tty.4,v 1.30 2019/09/07 19:32:52 wiz Exp $
+.\"	$NetBSD: tty.4,v 1.31 2021/08/17 14:11:22 andvar Exp $
 .\"
 .\" Copyright (c) 1991, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -478,7 +478,7 @@ Return the current line discipline in th
 .Sh HISTORY
 A console typewriter device
 .Pa /dev/tty
-and asynchronus communication interfaces
+and asynchronous communication interfaces
 .Pa /dev/tty[0-5]
 first appeared in
 .At v1 .



CVS commit: src/sys/netinet6

2021-08-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Aug 17 09:43:21 UTC 2021

Modified Files:
src/sys/netinet6: nd6.c

Log Message:
nd6: prevent ln from being freed while releasing held packets


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.276 src/sys/netinet6/nd6.c:1.277
--- src/sys/netinet6/nd6.c:1.276	Mon Dec 28 20:19:50 2020
+++ src/sys/netinet6/nd6.c	Tue Aug 17 09:43:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $	*/
+/*	$NetBSD: nd6.c,v 1.277 2021/08/17 09:43:21 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.277 2021/08/17 09:43:21 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1305,6 +1305,7 @@ nd6_llinfo_release_pkts(struct llentry *
 
 	m_hold = ln->la_hold, ln->la_hold = NULL, ln->la_numheld = 0;
 
+	LLE_ADDREF(ln);
 	LLE_WUNLOCK(ln);
 	for (; m_hold != NULL; m_hold = m_hold_next) {
 		m_hold_next = m_hold->m_nextpkt;
@@ -1318,6 +1319,7 @@ nd6_llinfo_release_pkts(struct llentry *
 		ip6_if_output(ifp, ifp, m_hold, , NULL);
 	}
 	LLE_WLOCK(ln);
+	LLE_REMREF(ln);
 }
 
 /*



CVS commit: src/usr.bin/progress

2021-08-17 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Aug 17 07:18:43 UTC 2021

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

Log Message:
Add missing check for error returns from read().  Found by inspection
while reviewing the changes suggested by RVP in PR install/56303, but
not believed to be the cause of the failure reported in that PR.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/progress/progress.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/progress/progress.c
diff -u src/usr.bin/progress/progress.c:1.24 src/usr.bin/progress/progress.c:1.25
--- src/usr.bin/progress/progress.c:1.24	Mon Aug  9 10:46:39 2021
+++ src/usr.bin/progress/progress.c	Tue Aug 17 07:18:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: progress.c,v 1.24 2021/08/09 10:46:39 gson Exp $ */
+/*	$NetBSD: progress.c,v 1.25 2021/08/17 07:18:43 gson Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: progress.c,v 1.24 2021/08/09 10:46:39 gson Exp $");
+__RCSID("$NetBSD: progress.c,v 1.25 2021/08/17 07:18:43 gson Exp $");
 #endif/* not lint */
 
 #include 
@@ -231,7 +231,11 @@ main(int argc, char *argv[])
 		do {
 			nr = read(fd, fb_buf, buffersize);
 		} while (nr < 0 && errno == EINTR);
-		if (nr <= 0)
+		if (nr < 0) {
+			progressmeter(1);
+			err(1, "reading input");
+		}
+		if (nr == 0)
 			break;
 		for (off = 0; nr; nr -= nw, off += nw, bytes += nw)
 			if ((nw = write(outpipe[1], fb_buf + off,



CVS commit: src/external/bsd/openldap/lib/libldap_r

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 17 01:59:16 UTC 2021

Modified Files:
src/external/bsd/openldap/lib/libldap_r: Makefile

Log Message:
add missing tpool.c.  fixes libreoffice build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/openldap/lib/libldap_r/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/bsd/openldap/lib/libldap_r/Makefile
diff -u src/external/bsd/openldap/lib/libldap_r/Makefile:1.6 src/external/bsd/openldap/lib/libldap_r/Makefile:1.7
--- src/external/bsd/openldap/lib/libldap_r/Makefile:1.6	Sat Aug 14 16:15:04 2021
+++ src/external/bsd/openldap/lib/libldap_r/Makefile	Tue Aug 17 01:59:16 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2021/08/14 16:15:04 christos Exp $
+#	$NetBSD: Makefile,v 1.7 2021/08/17 01:59:16 mrg Exp $
 
 USE_FORT?=	yes
 CWARNFLAGS.clang=	-Wno-format-extra-args
@@ -11,7 +11,7 @@ LIB=		ldap_r
 
 SRCS+=		threads.c rdwr.c rq.c \
 		thr_posix.c thr_thr.c thr_nt.c \
-		thr_pth.c thr_debug.c
+		thr_pth.c thr_debug.c tpool.c
 
 COPTS+=		-pthread
 LIBDPLIBS+=	pthread	${.CURDIR}/../../../../../lib/libpthread



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 20:27:31 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_promote.c expr_promote.exp-ln
expr_promote_trad.c expr_promote_trad.exp-ln

Log Message:
tests/lint: test default argument promotion with enum


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/expr_promote.c \
src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln \
src/tests/usr.bin/xlint/lint1/expr_promote_trad.c \
src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/expr_promote.c
diff -u src/tests/usr.bin/xlint/lint1/expr_promote.c:1.1 src/tests/usr.bin/xlint/lint1/expr_promote.c:1.2
--- src/tests/usr.bin/xlint/lint1/expr_promote.c:1.1	Mon Aug 16 20:11:03 2021
+++ src/tests/usr.bin/xlint/lint1/expr_promote.c	Mon Aug 16 20:27:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_promote.c,v 1.1 2021/08/16 20:11:03 rillig Exp $	*/
+/*	$NetBSD: expr_promote.c,v 1.2 2021/08/16 20:27:31 rillig Exp $	*/
 # 3 "expr_promote.c"
 
 /*
@@ -28,6 +28,9 @@ struct arithmetic_types {
 	float _Complex float_complex;
 	double _Complex double_complex;
 	long double _Complex long_double_complex;
+	enum {
+		E
+	} enumerator;
 };
 
 void
@@ -51,7 +54,15 @@ caller(struct arithmetic_types *arg)
 	arg->long_floating,
 	arg->float_complex,
 	arg->double_complex,
-	arg->long_double_complex);
+	arg->long_double_complex,
+	arg->enumerator);
 }
 
-/* XXX: _Bool is not promoted but should. */
+/*
+ * XXX: _Bool should be promoted to 'int', C99 6.3.1.1p2 "If an int can
+ * represent ...".
+ */
+/*
+ * XXX: Enumerations may need be promoted to 'int', at least C99 6.3.1.1p2
+ * suggests that: "If an int can represent ...".
+ */
Index: src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln
diff -u src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln:1.1 src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln:1.2
--- src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln:1.1	Mon Aug 16 20:11:03 2021
+++ src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln	Mon Aug 16 20:27:31 2021
@@ -1,5 +1,5 @@
 0sexpr_promote.c
 Sexpr_promote.c
 10d0.10e4sinkF2PcCEV
-54c0.54i4sinkf19PcCBIIuILuLQuQDDlDsXXlXV
-34d0.34d6callerF1PsT116arithmetic_typesV
+58c0.58i4sinkf20PcCBIIuILuLQuQDDlDsXXlXeT331.0.0V
+37d0.37d6callerF1PsT116arithmetic_typesV
Index: src/tests/usr.bin/xlint/lint1/expr_promote_trad.c
diff -u src/tests/usr.bin/xlint/lint1/expr_promote_trad.c:1.1 src/tests/usr.bin/xlint/lint1/expr_promote_trad.c:1.2
--- src/tests/usr.bin/xlint/lint1/expr_promote_trad.c:1.1	Mon Aug 16 20:11:03 2021
+++ src/tests/usr.bin/xlint/lint1/expr_promote_trad.c	Mon Aug 16 20:27:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_promote_trad.c,v 1.1 2021/08/16 20:11:03 rillig Exp $	*/
+/*	$NetBSD: expr_promote_trad.c,v 1.2 2021/08/16 20:27:31 rillig Exp $	*/
 # 3 "expr_promote_trad.c"
 
 /*
@@ -27,6 +27,9 @@ struct arithmetic_types {
 	double double_floating;
 	/* long double is not available in traditional C */
 	/* _Complex is not available in traditional C */
+	enum {
+		E
+	} enumerator;
 };
 
 caller(arg)
@@ -42,5 +45,11 @@ caller(arg)
 	arg->signed_long,
 	arg->unsigned_long,
 	arg->single_floating,	/* gets promoted to 'double' */
-	arg->double_floating);
+	arg->double_floating,
+	arg->enumerator);
 }
+
+/*
+ * XXX: Enumerations may need be promoted to 'int', at least C99 6.3.1.1p2
+ * suggests that: "If an int can represent ...".
+ */
Index: src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln
diff -u src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln:1.1 src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln:1.2
--- src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln:1.1	Mon Aug 16 20:11:03 2021
+++ src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln	Mon Aug 16 20:27:31 2021
@@ -1,5 +1,5 @@
 0sexpr_promote_trad.c
 Sexpr_promote_trad.c
 10d0.10e4sinkFI
-45c0.45s1""i4sinkf11PCIuIIuIIuILuLDDI
-32d0.32do6callerf1PsT116arithmetic_typesI
+49c0.49s1""i4sinkf12PCIuIIuIIuILuLDDeT330.0.0I
+35d0.35do6callerf1PsT116arithmetic_typesI



CVS commit: src

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 20:11:03 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile msg_241.c msg_277.c msg_277.exp
Added Files:
src/tests/usr.bin/xlint/lint1: expr_promote.c expr_promote.exp-ln
expr_promote_trad.c expr_promote_trad.exp-ln

Log Message:
tests/lint: test arithmetic promotions and enums


To generate a diff of this commit:
cvs rdiff -u -r1. -r1.1112 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.103 -r1.104 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/expr_promote.c \
src/tests/usr.bin/xlint/lint1/expr_promote.exp-ln \
src/tests/usr.bin/xlint/lint1/expr_promote_trad.c \
src/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_241.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_277.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_277.exp

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1. src/distrib/sets/lists/tests/mi:1.1112
--- src/distrib/sets/lists/tests/mi:1.	Thu Aug 12 15:06:39 2021
+++ src/distrib/sets/lists/tests/mi	Mon Aug 16 20:11:03 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1. 2021/08/12 15:06:39 martin Exp $
+# $NetBSD: mi,v 1.1112 2021/08/16 20:11:03 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6249,6 +6249,10 @@
 ./usr/tests/usr.bin/xlint/lint1/expr_cast.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/expr_precedence.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/expr_precedence.exp		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/expr_promote.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/expr_promote.exp-ln		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/expr_promote_trad.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/expr_promote_trad.exp-ln	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/expr_range.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/expr_range.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.c		tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.103 src/tests/usr.bin/xlint/lint1/Makefile:1.104
--- src/tests/usr.bin/xlint/lint1/Makefile:1.103	Mon Aug  9 20:07:24 2021
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Aug 16 20:11:03 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.103 2021/08/09 20:07:24 rillig Exp $
+# $NetBSD: Makefile,v 1.104 2021/08/16 20:11:03 rillig Exp $
 
 NOMAN=		# defined
 MAX_MESSAGE=	346		# see lint1/err.c
@@ -141,6 +141,10 @@ FILES+=		expr_cast.c
 FILES+=		expr_cast.exp
 FILES+=		expr_precedence.c
 FILES+=		expr_precedence.exp
+FILES+=		expr_promote.c
+FILES+=		expr_promote.exp-ln
+FILES+=		expr_promote_trad.c
+FILES+=		expr_promote_trad.exp-ln
 FILES+=		expr_range.c
 FILES+=		expr_range.exp
 FILES+=		feat_stacktrace.c

Index: src/tests/usr.bin/xlint/lint1/msg_241.c
diff -u src/tests/usr.bin/xlint/lint1/msg_241.c:1.5 src/tests/usr.bin/xlint/lint1/msg_241.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_241.c:1.5	Mon Aug 16 18:51:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_241.c	Mon Aug 16 20:11:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_241.c,v 1.5 2021/08/16 18:51:58 rillig Exp $	*/
+/*	$NetBSD: msg_241.c,v 1.6 2021/08/16 20:11:03 rillig Exp $	*/
 # 3 "msg_241.c"
 
 // Test for message: dubious operation on enum, op %s [241]
@@ -82,3 +82,15 @@ cover_typeok_enum(enum color c, int i)
 	if (c * i > 5)
 		return;
 }
+
+const char *
+color_name(enum color c)
+{
+	static const char *name[] = { "red", "green", "blue" };
+
+	if (c == RED)
+		return *(c + name); /* unusual but allowed */
+	if (c == GREEN)
+		return c[name]; /* even more unusual */
+	return name[c];
+}

Index: src/tests/usr.bin/xlint/lint1/msg_277.c
diff -u src/tests/usr.bin/xlint/lint1/msg_277.c:1.4 src/tests/usr.bin/xlint/lint1/msg_277.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_277.c:1.4	Sat Feb 27 18:01:29 2021
+++ src/tests/usr.bin/xlint/lint1/msg_277.c	Mon Aug 16 20:11:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_277.c,v 1.4 2021/02/27 18:01:29 rillig Exp $	*/
+/*	$NetBSD: msg_277.c,v 1.5 2021/08/16 20:11:03 rillig Exp $	*/
 # 3 "msg_277.c"
 
 // Test for message: initialization of '%s' with '%s' [277]
@@ -24,4 +24,8 @@ example(enum E e, int i)
 	sink_enum(e3);
 	sink_int(i2);
 	sink_int(i3);
+
+	enum E init_0 = 0;
+	/* expect+1: warning: initialization of 'enum E' with 'int' [277] */
+	enum E init_1 = 1;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_277.exp

CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 18:51:58 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_123.c msg_123.exp msg_182.c
msg_182.exp msg_211.c msg_211.exp msg_241.c msg_241.exp msg_303.c
msg_303.exp msg_304.c msg_304.exp msg_305.c msg_305.exp msg_346.c
msg_346.exp

Log Message:
tests/lint: add tests for several messages about type mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_123.c \
src/tests/usr.bin/xlint/lint1/msg_182.c \
src/tests/usr.bin/xlint/lint1/msg_182.exp \
src/tests/usr.bin/xlint/lint1/msg_211.c \
src/tests/usr.bin/xlint/lint1/msg_211.exp \
src/tests/usr.bin/xlint/lint1/msg_303.c \
src/tests/usr.bin/xlint/lint1/msg_303.exp \
src/tests/usr.bin/xlint/lint1/msg_304.c \
src/tests/usr.bin/xlint/lint1/msg_304.exp \
src/tests/usr.bin/xlint/lint1/msg_305.c \
src/tests/usr.bin/xlint/lint1/msg_305.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_123.exp \
src/tests/usr.bin/xlint/lint1/msg_241.exp \
src/tests/usr.bin/xlint/lint1/msg_346.c \
src/tests/usr.bin/xlint/lint1/msg_346.exp
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_241.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_123.c
diff -u src/tests/usr.bin/xlint/lint1/msg_123.c:1.2 src/tests/usr.bin/xlint/lint1/msg_123.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_123.c:1.2	Sun Jan 17 16:00:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_123.c	Mon Aug 16 18:51:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_123.c,v 1.2 2021/01/17 16:00:16 rillig Exp $	*/
+/*	$NetBSD: msg_123.c,v 1.3 2021/08/16 18:51:58 rillig Exp $	*/
 # 3 "msg_123.c"
 
 // Test for message: illegal combination of %s (%s) and %s (%s), op %s [123]
@@ -26,3 +26,12 @@ compare(_Bool b, int i, double d, const 
 	bad(p < d);		/* expect: 107 */
 	ok(p < p);
 }
+
+void
+cover_check_assign_types_compatible(int *int_pointer, int i)
+{
+	/* expect+1: warning: illegal combination of pointer (pointer to int) and integer (int), op = [123] */
+	int_pointer = i;
+	/* expect+1: warning: illegal combination of integer (int) and pointer (pointer to int), op = [123] */
+	i = int_pointer;
+}
Index: src/tests/usr.bin/xlint/lint1/msg_182.c
diff -u src/tests/usr.bin/xlint/lint1/msg_182.c:1.2 src/tests/usr.bin/xlint/lint1/msg_182.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_182.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_182.c	Mon Aug 16 18:51:58 2021
@@ -1,7 +1,18 @@
-/*	$NetBSD: msg_182.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_182.c,v 1.3 2021/08/16 18:51:58 rillig Exp $	*/
 # 3 "msg_182.c"
 
 // Test for message: incompatible pointer types (%s != %s) [182]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+void *
+return_discarding_volatile(volatile void *arg)
+{
+	/* expect+1: warning: incompatible pointer types (void != volatile void) [182] */
+	return arg;
+}
+
+void
+init_discarding_volatile(volatile void *arg)
+{
+	/* expect+1: warning: incompatible pointer types (void != volatile void) [182] */
+	void *array[] = { arg };
+}
Index: src/tests/usr.bin/xlint/lint1/msg_182.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_182.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_182.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_182.exp:1.2	Sun Mar 21 20:45:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_182.exp	Mon Aug 16 18:51:58 2021
@@ -1 +1,2 @@
-msg_182.c(6): error: syntax error ':' [249]
+msg_182.c(10): warning: incompatible pointer types (void != volatile void) [182]
+msg_182.c(17): warning: incompatible pointer types (void != volatile void) [182]
Index: src/tests/usr.bin/xlint/lint1/msg_211.c
diff -u src/tests/usr.bin/xlint/lint1/msg_211.c:1.2 src/tests/usr.bin/xlint/lint1/msg_211.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_211.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_211.c	Mon Aug 16 18:51:58 2021
@@ -1,7 +1,22 @@
-/*	$NetBSD: msg_211.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_211.c,v 1.3 2021/08/16 18:51:58 rillig Exp $	*/
 # 3 "msg_211.c"
 
 // Test for message: return value type mismatch (%s) and (%s) [211]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+struct str {
+	int member;
+};
+
+int
+return_int(double dbl, void *ptr, struct str str)
+{
+	if (dbl > 0.0)
+		return dbl;
+	if (ptr != (void *)0)
+		/* expect+1: warning: illegal combination of integer (int) and pointer (pointer to void) [183] */
+		return ptr;
+	if (str.member > 0)
+		/* expect+1: error: return value type mismatch (int) and (struct str) [211 */
+		return str;
+	return 3;
+}
Index: src/tests/usr.bin/xlint/lint1/msg_211.exp
diff 

CVS commit: src/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 18:51:03 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: remove dead code from check_bad_enum_operation

There is a single caller of that function, and it checks the exact same
condition beforehand.


To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.336 src/usr.bin/xlint/lint1/tree.c:1.337
--- src/usr.bin/xlint/lint1/tree.c:1.336	Sun Aug 15 14:26:39 2021
+++ src/usr.bin/xlint/lint1/tree.c	Mon Aug 16 18:51:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.337 2021/08/16 18:51:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.337 2021/08/16 18:51:03 rillig Exp $");
 #endif
 
 #include 
@@ -1587,11 +1587,6 @@ check_bad_enum_operation(op_t op, const 
 	if (!eflag)
 		return;
 
-	if (!(ln->tn_type->t_is_enum ||
-	  (modtab[op].m_binary && rn->tn_type->t_is_enum))) {
-		return;
-	}
-
 	/*
 	 * Enum as offset to a pointer is an exception (otherwise enums
 	 * could not be used as array indices).
@@ -1604,7 +1599,6 @@ check_bad_enum_operation(op_t op, const 
 
 	/* dubious operation on enum, op %s */
 	warning(241, op_name(op));
-
 }
 
 /*



CVS commit: src/external/gpl3/gcc

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 16 18:43:09 UTC 2021

Removed Files:
src/external/gpl3/gcc/lib/libbacktrace/arch/arm: backtrace-supported.h
config.h
src/external/gpl3/gcc/lib/libbacktrace/arch/armeb:
backtrace-supported.h config.h
src/external/gpl3/gcc/lib/libgcc/arch/arm: auto-target.h defs.mk
gthr-defs.mk
src/external/gpl3/gcc/lib/libgcc/arch/armeb: auto-target.h defs.mk
gthr-defs.mk
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/arm: defs.mk gcov-iov.h
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/armeb: defs.mk gcov-iov.h
src/external/gpl3/gcc/lib/libgomp/arch/arm: config.h libgomp.spec
libgomp_f.h omp.h
src/external/gpl3/gcc/lib/libgomp/arch/armeb: config.h libgomp.spec
libgomp_f.h omp.h
src/external/gpl3/gcc/lib/libiberty/arch/arm: config.h
src/external/gpl3/gcc/lib/libiberty/arch/armeb: config.h
src/external/gpl3/gcc/lib/libobjc/arch/arm: config.h defs.mk
src/external/gpl3/gcc/lib/libobjc/arch/armeb: config.h defs.mk
src/external/gpl3/gcc/lib/libstdc++-v3/arch/arm: c++config.h
cxxabi_tweaks.h defs.mk gstdint.h symver-config.h
src/external/gpl3/gcc/lib/libstdc++-v3/arch/armeb: c++config.h
cxxabi_tweaks.h defs.mk gstdint.h symver-config.h
src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/aarch64:
Makefile
src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/arm: Makefile
src/external/gpl3/gcc/usr.bin/gcc/arch/arm: all-tree.def
arm-cpu-cdata.h arm-cpu-data.h arm-cpu.h arm-isa.h auto-host.h
bconfig.h bversion.h config.h configargs.h defs.mk gthr-default.h
gtyp-input.list insn-modes.h multilib.h plugin-version.h tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb: all-tree.def
arm-cpu-cdata.h arm-cpu-data.h arm-cpu.h arm-isa.h auto-host.h
bconfig.h bversion.h config.h configargs.h defs.mk gthr-default.h
gtyp-input.list insn-modes.h multilib.h plugin-version.h tm.h
src/external/gpl3/gcc/usr.bin/libcpp/arch/arm: config.h
src/external/gpl3/gcc/usr.bin/libcpp/arch/armeb: config.h
src/external/gpl3/gcc/usr.bin/libdecnumber/arch/arm: config.h
src/external/gpl3/gcc/usr.bin/libdecnumber/arch/armeb: config.h

Log Message:
remove unused oabi mknative output.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r0 \
src/external/gpl3/gcc/lib/libbacktrace/arch/arm/backtrace-supported.h
cvs rdiff -u -r1.6 -r0 \
src/external/gpl3/gcc/lib/libbacktrace/arch/arm/config.h
cvs rdiff -u -r1.7 -r0 \
src/external/gpl3/gcc/lib/libbacktrace/arch/armeb/backtrace-supported.h
cvs rdiff -u -r1.5 -r0 \
src/external/gpl3/gcc/lib/libbacktrace/arch/armeb/config.h
cvs rdiff -u -r1.6 -r0 \
src/external/gpl3/gcc/lib/libgcc/arch/arm/auto-target.h \
src/external/gpl3/gcc/lib/libgcc/arch/arm/defs.mk
cvs rdiff -u -r1.1 -r0 src/external/gpl3/gcc/lib/libgcc/arch/arm/gthr-defs.mk
cvs rdiff -u -r1.6 -r0 \
src/external/gpl3/gcc/lib/libgcc/arch/armeb/auto-target.h
cvs rdiff -u -r1.5 -r0 src/external/gpl3/gcc/lib/libgcc/arch/armeb/defs.mk
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/gcc/lib/libgcc/arch/armeb/gthr-defs.mk
cvs rdiff -u -r1.5 -r0 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/arm/defs.mk
cvs rdiff -u -r1.16 -r0 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/arm/gcov-iov.h
cvs rdiff -u -r1.4 -r0 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/armeb/defs.mk
cvs rdiff -u -r1.15 -r0 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/armeb/gcov-iov.h
cvs rdiff -u -r1.9 -r0 src/external/gpl3/gcc/lib/libgomp/arch/arm/config.h
cvs rdiff -u -r1.3 -r0 \
src/external/gpl3/gcc/lib/libgomp/arch/arm/libgomp.spec
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gcc/lib/libgomp/arch/arm/libgomp_f.h
cvs rdiff -u -r1.8 -r0 src/external/gpl3/gcc/lib/libgomp/arch/arm/omp.h
cvs rdiff -u -r1.8 -r0 src/external/gpl3/gcc/lib/libgomp/arch/armeb/config.h
cvs rdiff -u -r1.3 -r0 \
src/external/gpl3/gcc/lib/libgomp/arch/armeb/libgomp.spec
cvs rdiff -u -r1.6 -r0 \
src/external/gpl3/gcc/lib/libgomp/arch/armeb/libgomp_f.h
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gcc/lib/libgomp/arch/armeb/omp.h
cvs rdiff -u -r1.8 -r0 src/external/gpl3/gcc/lib/libiberty/arch/arm/config.h
cvs rdiff -u -r1.9 -r0 \
src/external/gpl3/gcc/lib/libiberty/arch/armeb/config.h
cvs rdiff -u -r1.4 -r0 src/external/gpl3/gcc/lib/libobjc/arch/arm/config.h
cvs rdiff -u -r1.6 -r0 src/external/gpl3/gcc/lib/libobjc/arch/arm/defs.mk
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gcc/lib/libobjc/arch/armeb/config.h
cvs rdiff -u -r1.5 -r0 src/external/gpl3/gcc/lib/libobjc/arch/armeb/defs.mk
cvs rdiff -u -r1.36 -r0 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/arm/c++config.h
cvs rdiff -u -r1.7 -r0 \

CVS commit: src/external/gpl3/gcc

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 16 17:42:06 UTC 2021

Modified Files:
src/external/gpl3/gcc: README.gcc10

Log Message:
note sh3 switched.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gcc/README.gcc10

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

Modified files:

Index: src/external/gpl3/gcc/README.gcc10
diff -u src/external/gpl3/gcc/README.gcc10:1.23 src/external/gpl3/gcc/README.gcc10:1.24
--- src/external/gpl3/gcc/README.gcc10:1.23	Sat Jun 19 06:19:35 2021
+++ src/external/gpl3/gcc/README.gcc10	Mon Aug 16 17:42:05 2021
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc10,v 1.23 2021/06/19 06:19:35 mrg Exp $
+$NetBSD: README.gcc10,v 1.24 2021/08/16 17:42:05 mrg Exp $
 
 
 new stuff:
@@ -58,8 +58,8 @@ mips64eb	y	y	y	y		y		y	y	y
 mips64el	y	b	y	y		y		y	?	y
 powerpc		y	b	y	y		y		y	y	y
 powerpc64	y	b	y	y		y		N/A	N/A	y
-sh3eb		y	b	y	y		y		?	?	?
-sh3el		y	y	y	y		y		y	y[7]	n
+sh3eb		y	b	y	y		y		?[2]	?	y
+sh3el		y	y	y	y		y		y	y[7]	y
 sparc		y	y	y	y		y		y	y	y
 sparc64		y	y	y	y		y		y	y	y
 vax		y	y	y	y		y		y	n[6]	y
@@ -72,6 +72,7 @@ coldfire	?	N/A	?	?		?		N/A	N/A
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf
 
 [1] - kernel may be too large, does not boot.  GCC 9 is the same, though.
+[2] - failed to find any sh3-eb systems to test.
 [6] - vax vs c++ exceptions issue, same as it ever was
 [7] - fails just as poorly in gxemul/landisk as GCC 9
 [8] - i386 seems to have a signal delivery issue.  pthread tests hang and then



CVS commit: src/doc

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 16 17:41:00 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
note sh3 -> GCC 10.


To generate a diff of this commit:
cvs rdiff -u -r1.2821 -r1.2822 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2821 src/doc/CHANGES:1.2822
--- src/doc/CHANGES:1.2821	Sat Aug 14 23:56:32 2021
+++ src/doc/CHANGES	Mon Aug 16 17:41:00 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2821 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2822 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -406,3 +406,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		resulting in better network and storage performance.
 		[jmcneill 20210810]
 	openldap: Import 2.5.6. [christos 20210814]
+	sh3: Switch to GCC 10. [mrg 20210816]



CVS commit: src/share/mk

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 16 17:40:16 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch sh3 to GCC 10.  buh bye GCC 9!

thanks to everyone who helped (most espcially rin@.)


To generate a diff of this commit:
cvs rdiff -u -r1.1258 -r1.1259 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1258 src/share/mk/bsd.own.mk:1.1259
--- src/share/mk/bsd.own.mk:1.1258	Sun Jul 11 22:07:35 2021
+++ src/share/mk/bsd.own.mk	Mon Aug 16 17:40:16 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1258 2021/07/11 22:07:35 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1259 2021/08/16 17:40:16 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -72,11 +72,7 @@ TOOLCHAIN_MISSING?=	no
 #
 # What GCC is used?
 #
-.if ${MACHINE_CPU} != "sh3"
 HAVE_GCC?=	10
-.else
-HAVE_GCC?=	9
-.endif
 
 #
 # Platforms that can't run a modern GCC natively



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 16:19:47 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_115.c msg_115.exp

Log Message:
tests/lint: document history of initialization of const members


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_115.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_115.c
diff -u src/tests/usr.bin/xlint/lint1/msg_115.c:1.8 src/tests/usr.bin/xlint/lint1/msg_115.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_115.c:1.8	Sat Aug 14 12:46:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.c	Mon Aug 16 16:19:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_115.c,v 1.8 2021/08/14 12:46:24 rillig Exp $	*/
+/*	$NetBSD: msg_115.c,v 1.9 2021/08/16 16:19:47 rillig Exp $	*/
 # 3 "msg_115.c"
 
 // Test for message: %soperand of '%s' must be modifiable lvalue [115]
@@ -14,6 +14,10 @@ example(const int *const_ptr)
 	*const_ptr /= 5;	/* expect: 115 */
 	*const_ptr %= 9;	/* expect: 115 */
 	(*const_ptr)++;		/* expect: 115 */
+
+	/* In the next example, the left operand is not an lvalue at all. */
+	/* expect+1: error: left operand of '=' must be lvalue [114] */
+	(const_ptr + 3) = const_ptr;
 }
 
 typedef struct {
@@ -22,7 +26,15 @@ typedef struct {
 
 void take_const_member(const_member);
 
-/* see typeok_assign, has_constant_member */
+/*
+ * Before init.c 1.208 from 2021-08-14 and decl.c 1.221 from 2021-08-10,
+ * lint issued a wrong "warning: left operand of '%s' must be modifiable
+ * lvalue", even in cases where the left operand was being initialized
+ * instead of overwritten.
+ *
+ * See initialization_expr_using_op, typeok_assign, has_constant_member.
+ * See C99 6.2.5p25.
+ */
 const_member
 initialize_const_struct_member(void)
 {

Index: src/tests/usr.bin/xlint/lint1/msg_115.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_115.exp:1.7 src/tests/usr.bin/xlint/lint1/msg_115.exp:1.8
--- src/tests/usr.bin/xlint/lint1/msg_115.exp:1.7	Sat Aug 14 12:46:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.exp	Mon Aug 16 16:19:47 2021
@@ -5,3 +5,4 @@ msg_115.c(13): warning: left operand of 
 msg_115.c(14): warning: left operand of '/=' must be modifiable lvalue [115]
 msg_115.c(15): warning: left operand of '%=' must be modifiable lvalue [115]
 msg_115.c(16): warning: operand of 'x++' must be modifiable lvalue [115]
+msg_115.c(20): error: left operand of '=' must be lvalue [114]



CVS commit: src

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 06:49:57 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_046.c msg_046.exp msg_260.c
msg_260.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: add more details to message about redeclared tag


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_046.c \
src/tests/usr.bin/xlint/lint1/msg_046.exp \
src/tests/usr.bin/xlint/lint1/msg_260.c \
src/tests/usr.bin/xlint/lint1/msg_260.exp
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.136 -r1.137 src/usr.bin/xlint/lint1/err.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_046.c
diff -u src/tests/usr.bin/xlint/lint1/msg_046.c:1.3 src/tests/usr.bin/xlint/lint1/msg_046.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_046.c:1.3	Mon Aug 16 06:30:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_046.c	Mon Aug 16 06:49:57 2021
@@ -1,36 +1,36 @@
-/*	$NetBSD: msg_046.c,v 1.3 2021/08/16 06:30:43 rillig Exp $	*/
+/*	$NetBSD: msg_046.c,v 1.4 2021/08/16 06:49:57 rillig Exp $	*/
 # 3 "msg_046.c"
 
-// Test for message: (%s) tag redeclared [46]
+// Test for message: %s tag '%s' redeclared as %s [46]
 
 /* expect+1: warning: struct tag1 never defined [233] */
 struct tag1;
-/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+2: error: struct tag 'tag1' redeclared as union [46] */
 /* expect+1: warning: union tag1 never defined [234] */
 union tag1;
 
 /* expect+1: warning: union tag2 never defined [234] */
 union tag2;
-/* expect+2: error: (union) tag redeclared [46] */
+/* expect+2: error: union tag 'tag2' redeclared as enum [46] */
 /* expect+1: warning: enum tag2 never defined [235] */
 enum tag2;
 
 /* expect+1: warning: enum tag3 never defined [235] */
 enum tag3;
-/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+2: error: enum tag 'tag3' redeclared as struct [46] */
 /* expect+1: warning: struct tag3 never defined [233] */
 struct tag3;
 
-/* expect+2: error: (union) tag redeclared [46] */
+/* expect+2: error: union tag 'tag1' redeclared as struct [46] */
 /* expect+1: warning: struct tag1 never defined [233] */
 struct tag1 *use_tag1(void);
-/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+2: error: enum tag 'tag2' redeclared as union [46] */
 /* expect+1: warning: union tag2 never defined [234] */
 union tag2 *use_tag2(void);
-/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+2: error: struct tag 'tag3' redeclared as enum [46] */
 /* expect+1: warning: enum tag3 never defined [235] */
 enum tag3 *use_tag3(void);
 
-/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+2: error: struct tag 'tag1' redeclared as union [46] */
 /* expect+1: warning: union tag1 never defined [234] */
 union tag1 *mismatch_tag1(void);
Index: src/tests/usr.bin/xlint/lint1/msg_046.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_046.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_046.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_046.exp:1.3	Mon Aug 16 06:30:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_046.exp	Mon Aug 16 06:49:57 2021
@@ -1,10 +1,10 @@
-msg_046.c(10): error: (struct) tag redeclared [46]
-msg_046.c(16): error: (union) tag redeclared [46]
-msg_046.c(22): error: (enum) tag redeclared [46]
-msg_046.c(26): error: (union) tag redeclared [46]
-msg_046.c(29): error: (enum) tag redeclared [46]
-msg_046.c(32): error: (struct) tag redeclared [46]
-msg_046.c(36): error: (struct) tag redeclared [46]
+msg_046.c(10): error: struct tag 'tag1' redeclared as union [46]
+msg_046.c(16): error: union tag 'tag2' redeclared as enum [46]
+msg_046.c(22): error: enum tag 'tag3' redeclared as struct [46]
+msg_046.c(26): error: union tag 'tag1' redeclared as struct [46]
+msg_046.c(29): error: enum tag 'tag2' redeclared as union [46]
+msg_046.c(32): error: struct tag 'tag3' redeclared as enum [46]
+msg_046.c(36): error: struct tag 'tag1' redeclared as union [46]
 msg_046.c(7): warning: struct tag1 never defined [233]
 msg_046.c(10): warning: union tag1 never defined [234]
 msg_046.c(13): warning: union tag2 never defined [234]
Index: src/tests/usr.bin/xlint/lint1/msg_260.c
diff -u src/tests/usr.bin/xlint/lint1/msg_260.c:1.3 src/tests/usr.bin/xlint/lint1/msg_260.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_260.c:1.3	Sun Apr 18 07:31:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_260.c	Mon Aug 16 06:49:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_260.c,v 1.3 2021/04/18 07:31:47 rillig Exp $	*/
+/*	$NetBSD: msg_260.c,v 1.4 2021/08/16 06:49:57 rillig Exp $	*/
 # 3 "msg_260.c"
 
 // Test for message: previous declaration of %s [260]
@@ -6,22 +6,26 @@
 /* lint1-extra-flags: -r */
 
 # 100 "header.h" 1
-struct s {		/* expect: 260 */
+/* expect+1: previous declaration of s [260] */
+struct s {
 int member;
 };
-# 13 "msg_260.c" 2
+# 14 "msg_260.c" 2
 
 # 

CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 06:30:43 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_046.c msg_046.exp

Log Message:
tests/lint: test message for redeclared tags


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_046.c \
src/tests/usr.bin/xlint/lint1/msg_046.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_046.c
diff -u src/tests/usr.bin/xlint/lint1/msg_046.c:1.2 src/tests/usr.bin/xlint/lint1/msg_046.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_046.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_046.c	Mon Aug 16 06:30:43 2021
@@ -1,7 +1,36 @@
-/*	$NetBSD: msg_046.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_046.c,v 1.3 2021/08/16 06:30:43 rillig Exp $	*/
 # 3 "msg_046.c"
 
 // Test for message: (%s) tag redeclared [46]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* expect+1: warning: struct tag1 never defined [233] */
+struct tag1;
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: union tag1 never defined [234] */
+union tag1;
+
+/* expect+1: warning: union tag2 never defined [234] */
+union tag2;
+/* expect+2: error: (union) tag redeclared [46] */
+/* expect+1: warning: enum tag2 never defined [235] */
+enum tag2;
+
+/* expect+1: warning: enum tag3 never defined [235] */
+enum tag3;
+/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+1: warning: struct tag3 never defined [233] */
+struct tag3;
+
+/* expect+2: error: (union) tag redeclared [46] */
+/* expect+1: warning: struct tag1 never defined [233] */
+struct tag1 *use_tag1(void);
+/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+1: warning: union tag2 never defined [234] */
+union tag2 *use_tag2(void);
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: enum tag3 never defined [235] */
+enum tag3 *use_tag3(void);
+
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: union tag1 never defined [234] */
+union tag1 *mismatch_tag1(void);
Index: src/tests/usr.bin/xlint/lint1/msg_046.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_046.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_046.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_046.exp:1.2	Sun Mar 21 20:44:59 2021
+++ src/tests/usr.bin/xlint/lint1/msg_046.exp	Mon Aug 16 06:30:43 2021
@@ -1 +1,17 @@
-msg_046.c(6): error: syntax error ':' [249]
+msg_046.c(10): error: (struct) tag redeclared [46]
+msg_046.c(16): error: (union) tag redeclared [46]
+msg_046.c(22): error: (enum) tag redeclared [46]
+msg_046.c(26): error: (union) tag redeclared [46]
+msg_046.c(29): error: (enum) tag redeclared [46]
+msg_046.c(32): error: (struct) tag redeclared [46]
+msg_046.c(36): error: (struct) tag redeclared [46]
+msg_046.c(7): warning: struct tag1 never defined [233]
+msg_046.c(10): warning: union tag1 never defined [234]
+msg_046.c(13): warning: union tag2 never defined [234]
+msg_046.c(16): warning: enum tag2 never defined [235]
+msg_046.c(19): warning: enum tag3 never defined [235]
+msg_046.c(22): warning: struct tag3 never defined [233]
+msg_046.c(26): warning: struct tag1 never defined [233]
+msg_046.c(29): warning: union tag2 never defined [234]
+msg_046.c(32): warning: enum tag3 never defined [235]
+msg_046.c(36): warning: union tag1 never defined [234]



CVS commit: src/tools/gcc

2021-08-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 16 06:25:45 UTC 2021

Modified Files:
src/tools/gcc: mknative-gcc

Log Message:
fetch experimental_headers, experimental_bits_headers, and ext_host_headers
to install install experimental/* and ext/opt_random.h.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/tools/gcc/mknative-gcc

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

Modified files:

Index: src/tools/gcc/mknative-gcc
diff -u src/tools/gcc/mknative-gcc:1.114 src/tools/gcc/mknative-gcc:1.115
--- src/tools/gcc/mknative-gcc:1.114	Sun Apr 11 07:35:45 2021
+++ src/tools/gcc/mknative-gcc	Mon Aug 16 06:25:45 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-gcc,v 1.114 2021/04/11 07:35:45 mrg Exp $
+#	$NetBSD: mknative-gcc,v 1.115 2021/08/16 06:25:45 mrg Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of gcc.
@@ -234,8 +234,10 @@ get_libstdcxx_v3 () {
 	_headers1="$_headers1 pb_headers1 pb_headers2 pb_headers3 pb_headers4"
 	_headers1="$_headers1 pb_headers5 pb_headers6 pb_headers7"
 	_headers1="$_headers1 bits_headers ext_headers host_headers"
-	_headers1="$_headers1 thread_host_headers pstl_headers"
+	_headers1="$_headers1 pstl_headers"
 	_headers1="$_headers1 profile_headers profile_impl_headers"
+	_headers1="$_headers1 experimental_headers experimental_bits_headers"
+	_headers1="$_headers1 ext_host_headers"
 
 	# build files
 	for h in $_build_headers; do



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 06:24:37 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: accept.sh

Log Message:
tests/lint: remove unintended debugging output


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/accept.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/accept.sh
diff -u src/tests/usr.bin/xlint/lint1/accept.sh:1.6 src/tests/usr.bin/xlint/lint1/accept.sh:1.7
--- src/tests/usr.bin/xlint/lint1/accept.sh:1.6	Mon Aug 16 06:15:51 2021
+++ src/tests/usr.bin/xlint/lint1/accept.sh	Mon Aug 16 06:24:37 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: accept.sh,v 1.6 2021/08/16 06:15:51 rillig Exp $
+# $NetBSD: accept.sh,v 1.7 2021/08/16 06:24:37 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -85,7 +85,6 @@ for pattern in "$@"; do
 msgid=${msgid#msg_0}
 msgid=${msgid#msg_}
 msgid=${msgid%%_*}
-echo "msgid for $base is $msgid"
 if ! grep "\\[$msgid\\]" "$expfile" >/dev/null; then
 	echo "$base should trigger the message '$msgid'"
 fi



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Aug 16 06:15:51 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: accept.sh

Log Message:
tests/lint: fix check for expected message in msg tests


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/accept.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/accept.sh
diff -u src/tests/usr.bin/xlint/lint1/accept.sh:1.5 src/tests/usr.bin/xlint/lint1/accept.sh:1.6
--- src/tests/usr.bin/xlint/lint1/accept.sh:1.5	Sun Aug  8 13:19:51 2021
+++ src/tests/usr.bin/xlint/lint1/accept.sh	Mon Aug 16 06:15:51 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: accept.sh,v 1.5 2021/08/08 13:19:51 rillig Exp $
+# $NetBSD: accept.sh,v 1.6 2021/08/16 06:15:51 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -84,7 +84,8 @@ for pattern in "$@"; do
 msgid=${msgid#msg_00}
 msgid=${msgid#msg_0}
 msgid=${msgid#msg_}
-msgid=${msgid%_*}
+msgid=${msgid%%_*}
+echo "msgid for $base is $msgid"
 if ! grep "\\[$msgid\\]" "$expfile" >/dev/null; then
 	echo "$base should trigger the message '$msgid'"
 fi



CVS commit: src/lib/libedit

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 22:22:52 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
libedit: simplify calls to macro ADD_STRING

The lint comments CONSTCOND and LINTED were not necessary.  It is
simpler to just specify what to free.  GCC optimizes free(NULL) to be a
no-op.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/lib/libedit/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.161 src/lib/libedit/readline.c:1.162
--- src/lib/libedit/readline.c:1.161	Sun Aug 15 22:14:45 2021
+++ src/lib/libedit/readline.c	Sun Aug 15 22:22:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $	*/
+/*	$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $");
+__RCSID("$NetBSD: readline.c,v 1.162 2021/08/15 22:22:52 rillig Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -951,10 +951,7 @@ history_expand(char *str, char **output)
 			(size += len + 1) * sizeof(*nresult));	\
 			if (nresult == NULL) {\
 el_free(*output);			\
-if (/*CONSTCOND*/fr) {			\
-	/*LINTED*/			\
-	el_free(tmp);			\
-}	\
+el_free(fr);\
 return 0;\
 			}		\
 			result = nresult;\
@@ -1004,11 +1001,11 @@ loop:
 			goto loop;
 		}
 		len = i - start;
-		ADD_STRING([start], len, 0);
+		ADD_STRING([start], len, NULL);
 
 		if (str[i] == '\0' || str[i] != history_expansion_char) {
 			len = j - i;
-			ADD_STRING([i], len, 0);
+			ADD_STRING([i], len, NULL);
 			if (start == 0)
 ret = 0;
 			else
@@ -1018,7 +1015,7 @@ loop:
 		ret = _history_expand_command (str, i, (j - i), );
 		if (ret > 0 && tmp) {
 			len = strlen(tmp);
-			ADD_STRING(tmp, len, 1);
+			ADD_STRING(tmp, len, tmp);
 		}
 		if (tmp) {
 			el_free(tmp);



CVS commit: src/lib/libedit

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 22:14:45 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
readline: fix lint warning about effective unconst cast

Calling strchr to avoid the syntactical unconst cast is not necessary
here.  A simple pointer assignment is enough.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/lib/libedit/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.160 src/lib/libedit/readline.c:1.161
--- src/lib/libedit/readline.c:1.160	Sun Aug 15 10:06:32 2021
+++ src/lib/libedit/readline.c	Sun Aug 15 22:14:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -208,11 +208,10 @@ static void
 _resize_fun(EditLine *el, void *a)
 {
 	const LineInfo *li;
-	char **ap = a;
+	const char **ap = a;
 
 	li = el_line(el);
-	/* a cheesy way to get rid of const cast. */
-	*ap = memchr(li->buffer, *li->buffer, (size_t)1);
+	*ap = li->buffer;
 }
 
 static const char *



CVS commit: src/sys/sys

2021-08-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Aug 15 22:08:01 UTC 2021

Modified Files:
src/sys/sys: device.h

Log Message:
Define a constant for the size of device_t::dv_xname, rather than just
using 16.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/sys/device.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/sys/device.h
diff -u src/sys/sys/device.h:1.173 src/sys/sys/device.h:1.174
--- src/sys/sys/device.h:1.173	Sat Aug  7 18:16:42 2021
+++ src/sys/sys/device.h	Sun Aug 15 22:08:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.173 2021/08/07 18:16:42 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.174 2021/08/15 22:08:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -252,6 +252,9 @@ struct devhandle_impl {
 	const char *, devhandle_t *);
 };
 
+/* Max size of a device external name (including terminating NUL) */
+#define	DEVICE_XNAME_SIZE	16
+
 struct device {
 	devhandle_t	dv_handle;	/* this device's handle;
 	   new device_t's get INVALID */
@@ -262,7 +265,8 @@ struct device {
 	cfdriver_t	dv_cfdriver;	/* our cfdriver */
 	cfattach_t	dv_cfattach;	/* our cfattach */
 	int		dv_unit;	/* device unit number */
-	char		dv_xname[16];	/* external name (name + unit) */
+	/* external name (name + unit) */
+	char		dv_xname[DEVICE_XNAME_SIZE];
 	device_t	dv_parent;	/* pointer to parent device
 	   (NULL if pseudo- or root node) */
 	int		dv_depth;	/* number of parents until root */



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 21:51:56 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_193.c msg_193.exp

Log Message:
tests/lint: correct interpretation of NOTREACHED

The branch is unconditionally taken, therefore any later code is
unreachable as well.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/msg_193.c \
src/tests/usr.bin/xlint/lint1/msg_193.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_193.c
diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.13 src/tests/usr.bin/xlint/lint1/msg_193.c:1.14
--- src/tests/usr.bin/xlint/lint1/msg_193.c:1.13	Sun Aug 15 21:21:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.c	Sun Aug 15 21:51:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_193.c,v 1.13 2021/08/15 21:21:13 rillig Exp $	*/
+/*	$NetBSD: msg_193.c,v 1.14 2021/08/15 21:51:56 rillig Exp $	*/
 # 3 "msg_193.c"
 
 // Test for message: statement not reached [193]
@@ -645,7 +645,12 @@ lint_annotation_NOTREACHED(void)
 		suppressed();
 	}
 
-	/* FIXME: The 'if' statement _is_ reached. */
+	/*
+	 * Since the condition in the 'if' statement is constant, lint knows
+	 * that the branch is unconditionally taken.  The annotation comment
+	 * marks that branch as not reached, which means that any following
+	 * statement cannot be reached as well.
+	 */
 	/* expect+1: warning: statement not reached [193] */
 	if (1)
 		/* NOTREACHED */
Index: src/tests/usr.bin/xlint/lint1/msg_193.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13 src/tests/usr.bin/xlint/lint1/msg_193.exp:1.14
--- src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13	Sun Aug 15 21:21:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.exp	Sun Aug 15 21:51:56 2021
@@ -86,4 +86,4 @@ msg_193.c(580): warning: label 'six' unu
 msg_193.c(597): warning: statement not reached [193]
 msg_193.c(606): warning: statement not reached [193]
 msg_193.c(627): warning: statement not reached [193]
-msg_193.c(650): warning: statement not reached [193]
+msg_193.c(655): warning: statement not reached [193]



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 21:21:14 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_193.c msg_193.exp

Log Message:
tests/lint: test how NOTREACHED affects the unreachable warning

Inspired by lib/libedit/readline.c 1.159 from 2021-08-15.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/msg_193.c \
src/tests/usr.bin/xlint/lint1/msg_193.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_193.c
diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.12 src/tests/usr.bin/xlint/lint1/msg_193.c:1.13
--- src/tests/usr.bin/xlint/lint1/msg_193.c:1.12	Sun Jul 11 19:30:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.c	Sun Aug 15 21:21:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_193.c,v 1.12 2021/07/11 19:30:56 rillig Exp $	*/
+/*	$NetBSD: msg_193.c,v 1.13 2021/08/15 21:21:13 rillig Exp $	*/
 # 3 "msg_193.c"
 
 // Test for message: statement not reached [193]
@@ -616,3 +616,38 @@ reachable:
 /* TODO: switch */
 
 /* TODO: system-dependent constant expression (see tn_system_dependent) */
+
+void suppressed(void);
+
+void
+lint_annotation_NOTREACHED(void)
+{
+	if (0) {
+		/* expect+1: warning: statement not reached [193] */
+		unreachable();
+	}
+
+	if (0) {
+		/* NOTREACHED */
+		suppressed();
+	}
+
+	if (0)
+		/* NOTREACHED */
+		suppressed();
+
+	if (1) {
+		reachable();
+	}
+
+	if (1) {
+		/* NOTREACHED */
+		suppressed();
+	}
+
+	/* FIXME: The 'if' statement _is_ reached. */
+	/* expect+1: warning: statement not reached [193] */
+	if (1)
+		/* NOTREACHED */
+		suppressed();
+}
Index: src/tests/usr.bin/xlint/lint1/msg_193.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_193.exp:1.12 src/tests/usr.bin/xlint/lint1/msg_193.exp:1.13
--- src/tests/usr.bin/xlint/lint1/msg_193.exp:1.12	Sun Jul 11 19:30:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_193.exp	Sun Aug 15 21:21:13 2021
@@ -85,3 +85,5 @@ msg_193.c(540): warning: statement not r
 msg_193.c(580): warning: label 'six' unused in function 'test_goto_numbers_alphabetically' [232]
 msg_193.c(597): warning: statement not reached [193]
 msg_193.c(606): warning: statement not reached [193]
+msg_193.c(627): warning: statement not reached [193]
+msg_193.c(650): warning: statement not reached [193]



CVS commit: src/doc

2021-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 15 17:09:04 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
grep-3.7 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1810 -r1.1811 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1810 src/doc/3RDPARTY:1.1811
--- src/doc/3RDPARTY:1.1810	Sat Aug 14 16:20:31 2021
+++ src/doc/3RDPARTY	Sun Aug 15 17:09:03 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1810 2021/08/14 16:20:31 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1811 2021/08/15 17:09:03 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2081,7 +2081,7 @@ we use BSD-licensed implementation from 
 
 Package:	grep
 Version:	2.5.1a (last GPLv2+ version)
-Current Vers:	3.5
+Current Vers:	3.7
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/grep/
 Home Page:	http://www.gnu.org/software/grep/



CVS commit: src/external/cddl/osnet/dev/fbt/x86

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 16:33:57 UTC 2021

Modified Files:
src/external/cddl/osnet/dev/fbt/x86: fbt_isa.c

Log Message:
PR/56355: Taylor Campbell: restore strcmp() over strncmp()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.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/cddl/osnet/dev/fbt/x86/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.4 src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.5
--- src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c:1.4	Wed Aug 11 07:16:49 2021
+++ src/external/cddl/osnet/dev/fbt/x86/fbt_isa.c	Sun Aug 15 12:33:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.4 2021/08/11 11:16:49 christos Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.5 2021/08/15 16:33:57 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -251,9 +251,9 @@ fbt_provide_module_cb(const char *name, 
 	/*
 	 * Exclude some more symbols which can be called from probe context.
 	 */
-	if (strncmp(name, "trap", 4) ||
-	strncmp(name, "x86_curcpu", 10) == 0 ||
-	strncmp(name, "x86_curlwp", 10) == 0) {
+	if (strcmp(name, "trap") ||
+	strcmp(name, "x86_curcpu") == 0 ||
+	strcmp(name, "x86_curlwp") == 0) {
 		return 0;
 	}
 #endif



CVS commit: src/lib/libcurses

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 15:12:36 UTC 2021

Modified Files:
src/lib/libcurses: get_wstr.c getstr.c in_wchstr.c inchstr.c instr.c
inwstr.c

Log Message:
libcurses: fix usage of __warn_references

Since that macro can expand to an empty token list, it adds its own
semicolon as needed.  Removing the extra semicolon fixes the lint
warnings about empty declarations.  These empty declarations are a GCC
extension.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/get_wstr.c \
src/lib/libcurses/in_wchstr.c src/lib/libcurses/inwstr.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/getstr.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/inchstr.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/instr.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/libcurses/get_wstr.c
diff -u src/lib/libcurses/get_wstr.c:1.8 src/lib/libcurses/get_wstr.c:1.9
--- src/lib/libcurses/get_wstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/get_wstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif		  /* not lint */
 
 #include "curses.h"
@@ -61,7 +61,7 @@ getn_wstr(wchar_t *wstr, int n)
  *	Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(get_wstr,
-	"warning: this program uses get_wstr(), which is unsafe.");
+	"warning: this program uses get_wstr(), which is unsafe.")
 int
 get_wstr(wchar_t *wstr)
 {
@@ -83,7 +83,7 @@ mvgetn_wstr(int y, int x, wchar_t *wstr,
  *	  Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvget_wstr(int y, int x, wchar_t *wstr)
 {
@@ -109,7 +109,7 @@ mvwgetn_wstr(WINDOW *win, int y, int x, 
  *	  Get a string from the given window starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvwget_wstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
@@ -124,7 +124,7 @@ mvwget_wstr(WINDOW *win, int y, int x, w
  *	Get a string starting at (cury, curx).
  */
 __warn_references(wget_wstr,
-	"warning: this program uses wget_wstr(), which is unsafe.");
+	"warning: this program uses wget_wstr(), which is unsafe.")
 int
 wget_wstr(WINDOW *win, wchar_t *wstr)
 {
Index: src/lib/libcurses/in_wchstr.c
diff -u src/lib/libcurses/in_wchstr.c:1.8 src/lib/libcurses/in_wchstr.c:1.9
--- src/lib/libcurses/in_wchstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/in_wchstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif		  /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: in_wchstr.c,v 1.8 2019
  *	Return an array of wide characters at cursor position from stdscr.
  */
 __warn_references(in_wchstr,
-	"warning: this program uses in_wchstr(), which is unsafe.");
+	"warning: this program uses in_wchstr(), which is unsafe.")
 int
 in_wchstr(cchar_t *wchstr)
 {
@@ -65,7 +65,7 @@ in_wchnstr(cchar_t *wchstr, int n)
  *  Return an array of wide characters at position (y, x) from stdscr.
  */
 __warn_references(mvin_wchstr,
-	"warning: this program uses mvin_wchstr(), which is unsafe.");
+	"warning: this program uses mvin_wchstr(), which is unsafe.")
 int
 mvin_wchstr(int y, int x, cchar_t *wchstr)
 {
@@ -83,7 +83,7 @@ mvin_wchnstr(int y, int x, cchar_t *wchs
  *  Return an array wide characters at position (y, x) from the given window.
  */
 __warn_references(mvwin_wchstr,
-	"warning: this program uses mvwin_wchstr(), which is unsafe.");
+	"warning: this program uses mvwin_wchstr(), which is unsafe.")
 int
 mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr)
 {
@@ -107,7 +107,7 @@ mvwin_wchnstr(WINDOW *win, int y, int x,
  *	Return an array of characters at cursor position.
  */
 __warn_references(win_wchstr,
-	"warning: this program uses win_wchstr(), which is unsafe.");
+	"warning: this program uses win_wchstr(), which is unsafe.")
 int
 win_wchstr(WINDOW *win, cchar_t *wchstr)
 {
Index: src/lib/libcurses/inwstr.c
diff -u 

CVS commit: src

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 14:26:40 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_346.c msg_346.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: extend check for unconst functions

The functions memchr, strpbrk, strrchr and strstr effectively remove the
const qualifier of their first argument, just like strchr.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_346.c \
src/tests/usr.bin/xlint/lint1/msg_346.exp
cvs rdiff -u -r1.335 -r1.336 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_346.c
diff -u src/tests/usr.bin/xlint/lint1/msg_346.c:1.2 src/tests/usr.bin/xlint/lint1/msg_346.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_346.c:1.2	Sun Aug 15 14:00:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.c	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_346.c,v 1.2 2021/08/15 14:00:27 rillig Exp $	*/
+/*	$NetBSD: msg_346.c,v 1.3 2021/08/15 14:26:39 rillig Exp $	*/
 # 3 "msg_346.c"
 
 // Test for message: call to '%s' effectively discards 'const' from argument [346]
@@ -40,14 +40,14 @@ example(void)
 void
 all_functions(void)
 {
-	/* TODO: expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(memchr("string", 'c', 7));
 	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strchr("string", 'c'));
-	/* TODO: expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
 	take_char_ptr(strpbrk("string", "c"));
-	/* TODO: expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strrchr("string", 'c'));
-	/* TODO: expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
+	/* expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strstr("string", "c"));
 }
Index: src/tests/usr.bin/xlint/lint1/msg_346.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_346.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2	Sun Aug 15 14:00:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.exp	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,8 @@
 msg_346.c(26): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(32): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(37): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(44): warning: call to 'memchr' effectively discards 'const' from argument [346]
 msg_346.c(46): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(48): warning: call to 'strpbrk' effectively discards 'const' from argument [346]
+msg_346.c(50): warning: call to 'strrchr' effectively discards 'const' from argument [346]
+msg_346.c(52): warning: call to 'strstr' effectively discards 'const' from argument [346]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.335 src/usr.bin/xlint/lint1/tree.c:1.336
--- src/usr.bin/xlint/lint1/tree.c:1.335	Sun Aug 15 13:08:19 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Aug 15 14:26:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $");
 #endif
 
 #include 
@@ -1349,12 +1349,27 @@ check_pointer_comparison(op_t op, const 
 }
 
 static bool
-is_direct_function_call(const tnode_t *tn, const char *name)
+is_direct_function_call(const tnode_t *tn, const char **out_name)
 {
-	return tn->tn_op == CALL &&
-	   tn->tn_left->tn_op == ADDR &&
-	   tn->tn_left->tn_left->tn_op == NAME &&
-	   strcmp(tn->tn_left->tn_left->tn_sym->s_name, name) == 0;
+
+	if (!(tn->tn_op == CALL &&
+	  tn->tn_left->tn_op == ADDR &&
+	  tn->tn_left->tn_left->tn_op == NAME))
+		return false;
+
+	*out_name = tn->tn_left->tn_left->tn_sym->s_name;
+	return true;
+}
+
+static bool
+is_unconst_function(const char *name)
+{
+
+	return strcmp(name, "memchr") == 0 ||
+	   strcmp(name, "strchr") == 0 ||
+	   strcmp(name, "strpbrk") == 0 ||
+	   strcmp(name, "strrchr") == 0 ||
+	   strcmp(name, "strstr") == 0;
 }
 
 static bool
@@ 

CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 14:00:27 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_346.c msg_346.exp

Log Message:
tests/lint: add tests for more unconst functions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_346.c \
src/tests/usr.bin/xlint/lint1/msg_346.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_346.c
diff -u src/tests/usr.bin/xlint/lint1/msg_346.c:1.1 src/tests/usr.bin/xlint/lint1/msg_346.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_346.c:1.1	Mon Aug  9 20:07:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.c	Sun Aug 15 14:00:27 2021
@@ -1,9 +1,15 @@
-/*	$NetBSD: msg_346.c,v 1.1 2021/08/09 20:07:24 rillig Exp $	*/
+/*	$NetBSD: msg_346.c,v 1.2 2021/08/15 14:00:27 rillig Exp $	*/
 # 3 "msg_346.c"
 
 // Test for message: call to '%s' effectively discards 'const' from argument [346]
 
-char *strchr(const char *, int);
+typedef unsigned long size_t;
+
+void* memchr(const void *, int, size_t);		/* C99 7.21.5.1 */
+char *strchr(const char *, int);			/* C99 7.21.5.2 */
+char* strpbrk(const char *, const char *);		/* C99 7.21.5.4 */
+char* strrchr(const char *, int);			/* C99 7.21.5.5 */
+char* strstr(const char *, const char *);		/* C99 7.21.5.7 */
 
 void take_const_char_ptr(const char *);
 void take_char_ptr(char *);
@@ -30,3 +36,18 @@ example(void)
 	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
 	take_char_ptr(strchr("literal", 'c'));
 }
+
+void
+all_functions(void)
+{
+	/* TODO: expect+1: warning: call to 'memchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(memchr("string", 'c', 7));
+	/* expect+1: warning: call to 'strchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strchr("string", 'c'));
+	/* TODO: expect+1: warning: call to 'strpbrk' effectively discards 'const' from argument [346] */
+	take_char_ptr(strpbrk("string", "c"));
+	/* TODO: expect+1: warning: call to 'strrchr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strrchr("string", 'c'));
+	/* TODO: expect+1: warning: call to 'strstr' effectively discards 'const' from argument [346] */
+	take_char_ptr(strstr("string", "c"));
+}
Index: src/tests/usr.bin/xlint/lint1/msg_346.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_346.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_346.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_346.exp:1.1	Mon Aug  9 20:07:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.exp	Sun Aug 15 14:00:27 2021
@@ -1,3 +1,4 @@
-msg_346.c(20): warning: call to 'strchr' effectively discards 'const' from argument [346]
 msg_346.c(26): warning: call to 'strchr' effectively discards 'const' from argument [346]
-msg_346.c(31): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(32): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(37): warning: call to 'strchr' effectively discards 'const' from argument [346]
+msg_346.c(46): warning: call to 'strchr' effectively discards 'const' from argument [346]



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:32:44 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: bn.inc

Log Message:
libcrypto: suppress irrelevant lint warnings

The conversion from 'unsigned long' to 'int' in line 805 is due to the
laziness of declaring a carry flag as BN_ULONG, to save an extra
line of declaration.

The constants in conditional context come from the macro 'bn_cp_32'.

The unconst cast is used for initializing local BIGNUM constants; the
struct member is declared as non-const pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.6
--- src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc:1.5	Fri Feb  9 13:35:45 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/bn.inc	Sun Aug 15 13:32:43 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bn.inc,v 1.5 2018/02/09 13:35:45 christos Exp $
+#	$NetBSD: bn.inc,v 1.6 2021/08/15 13:32:43 rillig Exp $
 #
 #	@(#) Copyright (c) 1995 Simon J. Gerraty
 #
@@ -47,3 +47,7 @@ SRCS += ${BN_SRCS}
 .for cryptosrc in ${BN_SRCS}
 CPPFLAGS.${cryptosrc} = -I${OPENSSLSRC}/crypto/bn ${BNCPPFLAGS}
 .endfor
+
+LINTFLAGS.bn_nist.c+=	-X 132	# conversion from 'unsigned long' to 'int'
+LINTFLAGS.bn_nist.c+=	-X 161	# constant in conditional context
+LINTFLAGS.bn_nist.c+=	-X 275	# cast discards 'const' from type 'pointer to const unsigned long'



CVS commit: src

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:08:20 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix wrong warning about 'unsigned char >> constant'


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_117.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_117.exp
cvs rdiff -u -r1.334 -r1.335 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.6 src/tests/usr.bin/xlint/lint1/msg_117.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.6	Sun Aug 15 13:02:20 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c	Sun Aug 15 13:08:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_117.c,v 1.6 2021/08/15 13:02:20 rillig Exp $	*/
+/*	$NetBSD: msg_117.c,v 1.7 2021/08/15 13:08:20 rillig Exp $	*/
 # 3 "msg_117.c"
 
 // Test for message: bitwise '%s' on signed value possibly nonportable [117]
@@ -38,7 +38,10 @@ shr_rhs_constant_negative(int a)
 unsigned int
 shr_unsigned_char(unsigned char uc)
 {
-	/* FIXME: This value cannot actually be negative. */
-	/* expect+1: warning: bitwise '>>' on signed value possibly nonportable [117] */
+	/*
+	 * Even though 'uc' is promoted to 'int', it cannot be negative.
+	 * Before tree.c 1.335 from 2021-08-15, lint wrongly warned that
+	 * 'uc >> 4' might be a bitwise '>>' on signed value.
+	 */
 	return uc >> 4;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_117.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.6
--- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5	Sun Aug 15 13:02:20 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.exp	Sun Aug 15 13:08:20 2021
@@ -4,4 +4,3 @@ msg_117.c(29): warning: bitwise '>>' on 
 msg_117.c(29): warning: shift amount 4660 is greater than bit-size 32 of 'int' [122]
 msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
 msg_117.c(35): warning: negative shift [121]
-msg_117.c(43): warning: bitwise '>>' on signed value possibly nonportable [117]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.334 src/usr.bin/xlint/lint1/tree.c:1.335
--- src/usr.bin/xlint/lint1/tree.c:1.334	Sat Aug 14 13:00:55 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Aug 15 13:08:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.335 2021/08/15 13:08:19 rillig Exp $");
 #endif
 
 #include 
@@ -849,7 +849,7 @@ typeok_shr(const mod_t *mp,
 	ort = before_conversion(rn)->tn_type->t_tspec;
 
 	/* operands have integer types (checked above) */
-	if (pflag && !is_uinteger(lt)) {
+	if (pflag && !is_uinteger(olt)) {
 		/*
 		 * The left operand is signed. This means that
 		 * the operation is (possibly) nonportable.



CVS commit: src/tests/usr.bin/xlint/lint1

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 13:02:20 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp

Log Message:
tests/lint: demonstrate wrong warning about signed '>>'

Seen in libdes/ostr2key.c(81).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_117.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_117.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.5 src/tests/usr.bin/xlint/lint1/msg_117.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.5	Mon Apr  5 01:35:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c	Sun Aug 15 13:02:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_117.c,v 1.5 2021/04/05 01:35:34 rillig Exp $	*/
+/*	$NetBSD: msg_117.c,v 1.6 2021/08/15 13:02:20 rillig Exp $	*/
 # 3 "msg_117.c"
 
 // Test for message: bitwise '%s' on signed value possibly nonportable [117]
@@ -34,3 +34,11 @@ shr_rhs_constant_negative(int a)
 {
 	return a >> -0x1234;		/* expect: 117 *//* expect: 121 */
 }
+
+unsigned int
+shr_unsigned_char(unsigned char uc)
+{
+	/* FIXME: This value cannot actually be negative. */
+	/* expect+1: warning: bitwise '>>' on signed value possibly nonportable [117] */
+	return uc >> 4;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_117.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4	Tue Apr  6 21:32:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.exp	Sun Aug 15 13:02:20 2021
@@ -4,3 +4,4 @@ msg_117.c(29): warning: bitwise '>>' on 
 msg_117.c(29): warning: shift amount 4660 is greater than bit-size 32 of 'int' [122]
 msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
 msg_117.c(35): warning: negative shift [121]
+msg_117.c(43): warning: bitwise '>>' on signed value possibly nonportable [117]



CVS commit: src/crypto/external/bsd/openssl/lib/libdes

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 12:58:02 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/lib/libdes: Makefile

Log Message:
libdes: suppress some selected lint warnings

The type widths are handled carefully, so even if there is some
conversion from 64-bit long to uint32_t, no value bits get lost.

The fallthrough case statements are a variant of Duff's Device.

The bitwise '>>' on signed value is actually on a value of type
'unsigned char', and since all platforms supported by lint have
sizeof(int) == 4, the behavior is well defined.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssl/lib/libdes/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libdes/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.3 src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.4
--- src/crypto/external/bsd/openssl/lib/libdes/Makefile:1.3	Thu Mar 15 18:40:16 2018
+++ src/crypto/external/bsd/openssl/lib/libdes/Makefile	Sun Aug 15 12:58:01 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2018/03/15 18:40:16 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2021/08/15 12:58:01 rillig Exp $
 
 .include 
 
@@ -16,6 +16,9 @@ SRCS+=	ornd_keys.c
 
 CPPFLAGS+=-DOPENSSL_VERSION_PTEXT="\" based on OpenSSL 0.9.6j 10 Apr 2003\""
 CPPFLAGS+=-DOPENSSL_cleanse=bzero -DOPENSSL_malloc=malloc
+LINTFLAGS+=	-X 117	# bitwise '>>' on signed value possibly nonportable
+LINTFLAGS+=	-X 132	# conversion from 'long' to 'unsigned int'
+LINTFLAGS+=	-X 220	# fallthrough on case statement
 
 INCS=	des.h
 INCSDIR=/usr/include



CVS commit: src/external/bsd/jemalloc/lib

2021-08-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 15 12:41:40 UTC 2021

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
jemalloc: suppress two irrelevant lint warnings


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/jemalloc/lib/Makefile.inc

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.14 src/external/bsd/jemalloc/lib/Makefile.inc:1.15
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.14	Tue Jul  6 12:40:24 2021
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sun Aug 15 12:41:40 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2021/07/06 12:40:24 thorpej Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/08/15 12:41:40 rillig Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -44,6 +44,8 @@ witness.c
 CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD
 COPTS.${i}+= -fvisibility=hidden -funroll-loops
 COPTS.${i}+= ${${ACTIVE_CC} == "clang":? -Wno-atomic-alignment :}
+LINTFLAGS.${i}+=	-X 231	# argument unused
+LINTFLAGS.${i}+=	-X 220	# fallthrough on case statement
 .endfor
 
 COPTS.background_thread.c+=-Wno-error=stack-protector



CVS commit: src/lib/libcurses

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 12:39:39 UTC 2021

Modified Files:
src/lib/libcurses: curses_private.h slk.c

Log Message:
This is a mess; always define MB_LEN_MAX so both the regular and libhack
version of curses compiles. Really we should not be defining MB_LEN_MAX here,
and include  in curses_private.h to get it.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/slk.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/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.73 src/lib/libcurses/curses_private.h:1.74
--- src/lib/libcurses/curses_private.h:1.73	Sat Mar 14 21:12:47 2020
+++ src/lib/libcurses/curses_private.h	Sun Aug 15 08:39:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.73 2020/03/15 01:12:47 uwe Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.74 2021/08/15 12:39:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -299,8 +299,14 @@ struct __screen {
 	bool		 slk_hidden;
 	struct __slk_label *slk_labels;
 
-#ifdef HAVE_WCHAR
+/*
+ * XXX: This conflicts with the value in  (32)
+ * which should be used here instead of defining a different value,
+ * but I am not changing it because it is also used in the WCOL()
+ * macro and I don't understand the effects of it.
+ */
 #define MB_LEN_MAX 8
+#ifdef HAVE_WCHAR
 #define MAX_CBUF_SIZE MB_LEN_MAX
 	int		cbuf_head;		/* header to cbuf */
 	int		cbuf_tail;		/* tail to cbuf */

Index: src/lib/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.13 src/lib/libcurses/slk.c:1.14
--- src/lib/libcurses/slk.c:1.13	Sun Aug 15 07:54:12 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 08:39:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $	*/
+/*	$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,13 +31,12 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $");
+__RCSID("$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $");
 #endif/* not lint */
 
 #include 
 #include 
 #include 
-#include 
 #ifdef HAVE_WCHAR
 #include 
 #endif



CVS commit: src/bin/csh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 12:16:02 UTC 2021

Modified Files:
src/bin/csh: set.c

Log Message:
Turn on EL_SAFEREAD


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/csh/set.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/csh/set.c
diff -u src/bin/csh/set.c:1.37 src/bin/csh/set.c:1.38
--- src/bin/csh/set.c:1.37	Sun Jan 12 13:42:41 2020
+++ src/bin/csh/set.c	Sun Aug 15 08:16:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: set.c,v 1.37 2020/01/12 18:42:41 christos Exp $ */
+/* $NetBSD: set.c,v 1.38 2021/08/15 12:16:02 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)set.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: set.c,v 1.37 2020/01/12 18:42:41 christos Exp $");
+__RCSID("$NetBSD: set.c,v 1.38 2021/08/15 12:16:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -158,6 +158,7 @@ update_vars(Char *vp)
 	el_set(el, EL_EDITOR, *vn ? short2str(vn) : "emacs");
 	el_set(el, EL_PROMPT, printpromptstr);
 	el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
+	el_set(el, EL_SAFEREAD, 1);
 	el_set(el, EL_ADDFN, "rl-complete",
 	"ReadLine compatible completion function", _el_fn_complete);
 	el_set(el, EL_BIND, "^I", adrof(STRfilec) ? "rl-complete" : "ed-insert",



CVS commit: src/bin/sh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:57:17 UTC 2021

Modified Files:
src/bin/sh: Makefile

Log Message:
Add -I to find filecomplete.h


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/bin/sh/Makefile

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

Modified files:

Index: src/bin/sh/Makefile
diff -u src/bin/sh/Makefile:1.116 src/bin/sh/Makefile:1.117
--- src/bin/sh/Makefile:1.116	Wed May 26 16:21:52 2021
+++ src/bin/sh/Makefile	Sun Aug 15 07:57:17 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.116 2021/05/26 20:21:52 christos Exp $
+#	$NetBSD: Makefile,v 1.117 2021/08/15 11:57:17 christos Exp $
 #	@(#)Makefile	8.4 (Berkeley) 5/5/95
 
 .include 
@@ -23,7 +23,7 @@ SCRIPT_ENV= \
 	MKTEMP=${TOOL_MKTEMP:Q} \
 	SED=${TOOL_SED:Q}
 
-CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
+CPPFLAGS+=-DSHELL -I. -I${.CURDIR} -I${NETBSDSRCDIR}/lib/libedit
 CPPFLAGS+= -DUSE_LRAND48
 #XXX: For testing only.
 #CPPFLAGS+=-DDEBUG=1



CVS commit: src/lib/libcurses

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:54:12 UTC 2021

Modified Files:
src/lib/libcurses: slk.c

Log Message:
need limits.h


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libcurses/slk.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/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.12 src/lib/libcurses/slk.c:1.13
--- src/lib/libcurses/slk.c:1.12	Sun Aug 15 07:44:39 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 07:54:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $	*/
+/*	$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,12 +31,13 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $");
+__RCSID("$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $");
 #endif/* not lint */
 
 #include 
 #include 
 #include 
+#include 
 #ifdef HAVE_WCHAR
 #include 
 #endif



CVS commit: src/lib/libcurses

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:44:39 UTC 2021

Modified Files:
src/lib/libcurses: slk.c

Log Message:
Use MBL_LEN_MAX (constant) so that SSP works


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/slk.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/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.11 src/lib/libcurses/slk.c:1.12
--- src/lib/libcurses/slk.c:1.11	Thu Jun 24 11:41:25 2021
+++ src/lib/libcurses/slk.c	Sun Aug 15 07:44:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $	*/
+/*	$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $");
+__RCSID("$NetBSD: slk.c,v 1.12 2021/08/15 11:44:39 christos Exp $");
 #endif/* not lint */
 
 #include 
@@ -818,7 +818,7 @@ __slk_draw(SCREEN *screen, int labnum)
 {
 	const struct __slk_label *l;
 	int retval, inc, lcnt, tx;
-	char ts[MB_CUR_MAX];
+	char ts[MB_LEN_MAX];
 #ifdef HAVE_WCHAR
 	cchar_t cc;
 	wchar_t wc[2];



CVS commit: src/usr.sbin/catman

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 11:00:43 UTC 2021

Modified Files:
src/usr.sbin/catman: catman.8

Log Message:
Restore BSD BUGS section


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/catman/catman.8

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/catman/catman.8
diff -u src/usr.sbin/catman/catman.8:1.11 src/usr.sbin/catman/catman.8:1.12
--- src/usr.sbin/catman/catman.8:1.11	Tue Feb 25 05:36:05 2003
+++ src/usr.sbin/catman/catman.8	Sun Aug 15 07:00:43 2021
@@ -27,9 +27,9 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"	$NetBSD: catman.8,v 1.11 2003/02/25 10:36:05 wiz Exp $
+.\"	$NetBSD: catman.8,v 1.12 2021/08/15 11:00:43 christos Exp $
 .\"
-.Dd July 30, 1993
+.Dd August 15, 2021
 .Dt CATMAN 8
 .Os
 .Sh NAME
@@ -104,3 +104,4 @@ Update manual pages in
 .Xr whatis 1
 .Sh BUGS
 Currently does not handle hard links.
+Acts oddly on nights with full moons.



CVS commit: src/bin/kill

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:58:04 UTC 2021

Modified Files:
src/bin/kill: kill.1

Log Message:
restore a bit of history.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/kill/kill.1

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

Modified files:

Index: src/bin/kill/kill.1
diff -u src/bin/kill/kill.1:1.33 src/bin/kill/kill.1:1.34
--- src/bin/kill/kill.1:1.33	Sun Aug 30 16:14:07 2020
+++ src/bin/kill/kill.1	Sun Aug 15 06:58:04 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kill.1,v 1.33 2020/08/30 20:14:07 wiz Exp $
+.\"	$NetBSD: kill.1,v 1.34 2021/08/15 10:58:04 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)kill.1	8.2 (Berkeley) 4/28/95
 .\"
-.Dd August 30, 2020
+.Dd August 15, 2021
 .Dt KILL 1
 .Os
 .Sh NAME
@@ -192,3 +192,5 @@ A
 command appeared in
 .At v3
 in section 8 of the manual.
+The original BSD description was: 
+.Sq terminate a process with extreme prejudice .



CVS commit: src/external/bsd/openldap/lib/libldap

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:33:58 UTC 2021

Modified Files:
src/external/bsd/openldap/lib/libldap: Makefile.libldap

Log Message:
Conditionalize GSSAPI use on USE_KERBEROS


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/bsd/openldap/lib/libldap/Makefile.libldap

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

Modified files:

Index: src/external/bsd/openldap/lib/libldap/Makefile.libldap
diff -u src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.11 src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.12
--- src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.11	Sat Aug 14 12:15:03 2021
+++ src/external/bsd/openldap/lib/libldap/Makefile.libldap	Sun Aug 15 06:33:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libldap,v 1.11 2021/08/14 16:15:03 christos Exp $
+#	$NetBSD: Makefile.libldap,v 1.12 2021/08/15 10:33:58 christos Exp $
 
 .include "../../openldap.mk"
 
@@ -24,7 +24,11 @@ CPPFLAGS+=	-DLDAP_LIBRARY -DHAVE_GSSAPI
 
 LIBDPLIBS+=	lber	${.CURDIR}/../liblber
 
+.if ${USE_KERBEROS} != "no"
+CPPFLAGS+=	-DHAVE_GSSAPI
 LIBDPLIBS+=	gssapi	${NETBSDSRCDIR}/crypto/external/bsd/heimdal/lib/libgssapi
+.endif
+
 LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto
 LIBDPLIBS+=	ssl	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libssl
 



CVS commit: src/share/mk

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:30:39 UTC 2021

Modified Files:
src/share/mk: bsd.prog.mk

Log Message:
Fix sun2 build for ldap/gssapi


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.337 src/share/mk/bsd.prog.mk:1.338
--- src/share/mk/bsd.prog.mk:1.337	Sat Aug 14 12:16:32 2021
+++ src/share/mk/bsd.prog.mk	Sun Aug 15 06:30:39 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.337 2021/08/14 16:16:32 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.338 2021/08/15 10:30:39 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -227,11 +227,13 @@ LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR}
 	${LIBHX509} ${LIBCRYPTO} ${LIBASN1} \
 	${LIBWIND} ${LIBHEIMBASE} ${LIBCOM_ERR} ${LIBROKEN} \
 	${LIBSQLITE3} ${LIBM} ${LIBCRYPT} ${LIBUTIL}
+LIBGSSAPI_LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD}
+LIBGSSAPI_DPADD+= ${LIBGSSAPI} ${LIBHEIMNTLM} ${LIBKRB5_DPADD}
 .endif
 
 .if (${MKLDAP} != "no")
-LIBLDAP_LDADD+= -lldap -llber -lgssapi -lssl -lcrypto 
-LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI} ${LIBSSL} ${LIBCRYPTO}
+LIBLDAP_LDADD+= -lldap -llber ${LIBGSSAPI_LDADD} -lssl -lcrypto 
+LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI_DPADD} ${LIBSSL} ${LIBCRYPTO}
 .endif
 
 # PAM applications, if linked statically, need more libraries



CVS commit: src/bin/sh

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:17:55 UTC 2021

Modified Files:
src/bin/sh: histedit.c myhistedit.h

Log Message:
- Add command completion (from FreeBSD)
- Use EL_SAFEREAD


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/bin/sh/histedit.c
cvs rdiff -u -r1.13 -r1.14 src/bin/sh/myhistedit.h

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

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.55 src/bin/sh/histedit.c:1.56
--- src/bin/sh/histedit.c:1.55	Sun Feb 10 14:21:52 2019
+++ src/bin/sh/histedit.c	Sun Aug 15 06:17:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.55 2019/02/10 19:21:52 kre Exp $	*/
+/*	$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,11 +37,13 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.55 2019/02/10 19:21:52 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.56 2021/08/15 10:17:55 christos Exp $");
 #endif
 #endif /* not lint */
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -71,13 +73,19 @@ History *hist;	/* history cookie */
 EditLine *el;	/* editline cookie */
 int displayhist;
 static FILE *el_in, *el_out;
-
-STATIC const char *fc_replace(const char *, char *, char *);
+static int curpos;
 
 #ifdef DEBUG
 extern FILE *tracefile;
 #endif
 
+static const char *fc_replace(const char *, char *, char *);
+static int not_fcnumber(const char *);
+static int str_to_event(const char *, int);
+static int comparator(const void *, const void *);
+static char **sh_matches(const char *, int, int);
+static unsigned char sh_complete(EditLine *, int);
+
 /*
  * Set history and editing status.  Called whenever the status may
  * have changed (figures out what to do).
@@ -136,10 +144,11 @@ histedit(void)
 
 set_prompt_lit(lookupvar("PSlit"));
 el_set(el, EL_SIGNAL, 1);
+el_set(el, EL_SAFEREAD, 1);
 el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
 el_set(el, EL_ADDFN, "rl-complete",
 "ReadLine compatible completion function",
-_el_fn_complete);
+sh_complete);
 			} else {
 bad:
 out2str("sh: can't initialize editing\n");
@@ -493,7 +502,7 @@ histcmd(volatile int argc, char ** volat
 	return 0;
 }
 
-STATIC const char *
+static const char *
 fc_replace(const char *s, char *p, char *r)
 {
 	char *dest;
@@ -512,20 +521,123 @@ fc_replace(const char *s, char *p, char 
 	STACKSTRNUL(dest);
 	dest = grabstackstr(dest);
 
-	return (dest);
+	return dest;
 }
 
-int
-not_fcnumber(char *s)
+
+/*
+ * Comparator function for qsort(). The use of curpos here is to skip
+ * characters that we already know to compare equal (common prefix).
+ */
+static int
+comparator(const void *a, const void *b)
+{
+	return strcmp(*(char *const *)a + curpos,
+		*(char *const *)b + curpos);
+}
+
+/*
+ * This function is passed to libedit's fn_complete(). The library will
+ * use it instead of its standard function to find matches, which
+ * searches for files in current directory. If we're at the start of the
+ * line, we want to look for available commands from all paths in $PATH.
+ */
+static char
+**sh_matches(const char *text, int start, int end)
+{
+	char *free_path = NULL, *dirname, *path;
+	char **matches = NULL;
+	size_t i = 0, size = 16;
+
+	if (start > 0)
+		return NULL;
+	curpos = end - start;
+	if ((free_path = path = strdup(pathval())) == NULL)
+		goto out;
+	if ((matches = malloc(size * sizeof(matches[0]))) == NULL)
+		goto out;
+	while ((dirname = strsep(, ":")) != NULL) {
+		struct dirent *entry;
+		DIR *dir;
+		int dfd;
+
+		if ((dir = opendir(dirname)) == NULL)
+			continue;
+		if ((dfd = dirfd(dir)) == -1)
+			continue;
+		while ((entry = readdir(dir)) != NULL) {
+			struct stat statb;
+
+			if (strncmp(entry->d_name, text, curpos) != 0)
+continue;
+			if (entry->d_type == DT_UNKNOWN || entry->d_type == DT_LNK) {
+if (fstatat(dfd, entry->d_name, , 0) == -1)
+	continue;
+if (!S_ISREG(statb.st_mode))
+	continue;
+			} else if (entry->d_type != DT_REG)
+continue;
+			if (++i >= size - 1) {
+size *= 2;
+if (reallocarr(, size,
+sizeof(*matches)))
+{
+	closedir(dir);
+	goto out;
+}
+			}
+			matches[i] = strdup(entry->d_name);
+		}
+		closedir(dir);
+	}
+out:
+	free(free_path);
+	if (i == 0) {
+		free(matches);
+		return NULL;
+	}
+	if (i == 1) {
+		matches[0] = strdup(matches[1]);
+		matches[i + 1] = NULL;
+	} else {
+		size_t j, k;
+
+		qsort(matches + 1, i, sizeof(matches[0]), comparator);
+		for (j = 1, k = 2; k <= i; k++)
+			if (strcmp(matches[j] + curpos, matches[k] + curpos)
+			== 0)
+free(matches[k]);
+			else
+matches[++j] = matches[k];
+		matches[0] = strdup(text);
+		matches[j + 1] = NULL;
+	}
+	return matches;
+}
+
+/*
+ * This is passed to el_set(el, EL_ADDFN, ...) so that it's possible to
+ * bind 

CVS commit: src/lib/libedit

2021-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 15 10:12:55 UTC 2021

Modified Files:
src/lib/libedit: editline.3

Log Message:
Add verb to sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/lib/libedit/editline.3

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

Modified files:

Index: src/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.100 src/lib/libedit/editline.3:1.101
--- src/lib/libedit/editline.3:1.100	Sun Aug 15 10:08:41 2021
+++ src/lib/libedit/editline.3	Sun Aug 15 10:12:54 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.100 2021/08/15 10:08:41 christos Exp $
+.\"	$NetBSD: editline.3,v 1.101 2021/08/15 10:12:54 wiz Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -508,9 +508,9 @@ In unbuffered mode,
 .Fn el_gets
 will return immediately after processing a single character.
 .It Dv EL_SAFEREAD , Fa "int flag"
-If
+If the
 .Fa flag
-argument non zero, then
+argument is non-zero, then
 .Nm editline
 attempts to recover from read errors, ignoring the first interrrupted
 error, and trying to reset the input file descriptor to reset non-blocking I/O.



CVS commit: src/lib/libedit

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:08:41 UTC 2021

Modified Files:
src/lib/libedit: editline.3 el.c el.h eln.c histedit.h read.c

Log Message:
Disable attempts to handle EINTR and non-blocking I/O by default. It is
confusing to other programs and unexpected behavior. Reported by Ingo Schwarze.
This behavior is now controlled with EL_SAFEREAD.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/lib/libedit/editline.3 src/lib/libedit/el.c
cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/el.h
cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/eln.c
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/histedit.h
cvs rdiff -u -r1.106 -r1.107 src/lib/libedit/read.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/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.99 src/lib/libedit/editline.3:1.100
--- src/lib/libedit/editline.3:1.99	Sun Nov 18 12:09:39 2018
+++ src/lib/libedit/editline.3	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.99 2018/11/18 17:09:39 christos Exp $
+.\"	$NetBSD: editline.3,v 1.100 2021/08/15 10:08:41 christos Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 9, 2018
+.Dd August 15, 2021
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -507,6 +507,16 @@ unbuffered mode is disabled (the default
 In unbuffered mode,
 .Fn el_gets
 will return immediately after processing a single character.
+.It Dv EL_SAFEREAD , Fa "int flag"
+If
+.Fa flag
+argument non zero, then
+.Nm editline
+attempts to recover from read errors, ignoring the first interrrupted
+error, and trying to reset the input file descriptor to reset non-blocking I/O.
+This is disabled by default, and desirable only when
+.Nm editline
+is used in shell-like applications.
 .It Dv EL_GETCFN , Fa "el_rfunc_t f"
 Whenever reading a character, use the function
 .Bd -ragged -offset indent -compact
@@ -634,6 +644,10 @@ call.
 Set
 .Fa c
 to non-zero if unbuffered mode is enabled.
+.It Dv EL_SAFEREAD , Fa "int *c"
+Set
+.Fa c
+to non-zero if safe read is set.
 .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp"
 Set
 .Fa fp
Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.99 src/lib/libedit/el.c:1.100
--- src/lib/libedit/el.c:1.99	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/el.c	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.100 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c	8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.99 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.100 2021/08/15 10:08:41 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -300,6 +300,14 @@ el_wset(EditLine *el, int op, ...)
 		break;
 	}
 
+	case EL_SAFEREAD:
+		if (va_arg(ap, int))
+			el->el_flags |= FIXIO;
+		else
+			el->el_flags &= ~FIXIO;
+		rv = 0;
+		break;
+
 	case EL_EDITMODE:
 		if (va_arg(ap, int))
 			el->el_flags &= ~EDIT_DISABLED;
@@ -429,6 +437,11 @@ el_wget(EditLine *el, int op, ...)
 		rv = 0;
 		break;
 
+	case EL_SAFEREAD:
+		*va_arg(ap, int *) = (el->el_flags & FIXIO);
+		rv = 0;
+		break;
+
 	case EL_TERMINAL:
 		terminal_get(el, va_arg(ap, const char **));
 		rv = 0;

Index: src/lib/libedit/el.h
diff -u src/lib/libedit/el.h:1.45 src/lib/libedit/el.h:1.46
--- src/lib/libedit/el.h:1.45	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/el.h	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.h,v 1.45 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: el.h,v 1.46 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -51,12 +51,13 @@
 
 #define	EL_BUFSIZ	((size_t)1024)	/* Maximum line size		*/
 
-#define	HANDLE_SIGNALS	0x01
-#define	NO_TTY		0x02
-#define	EDIT_DISABLED	0x04
-#define	UNBUFFERED	0x08
-#define	NARROW_HISTORY	0x40
-#define	NO_RESET	0x80
+#define	HANDLE_SIGNALS	0x001
+#define	NO_TTY		0x002
+#define	EDIT_DISABLED	0x004
+#define	UNBUFFERED	0x008
+#define	NARROW_HISTORY	0x040
+#define	NO_RESET	0x080
+#define	FIXIO		0x100
 
 typedef unsigned char el_action_t;	/* Index to command array	*/
 

Index: src/lib/libedit/eln.c
diff -u src/lib/libedit/eln.c:1.35 src/lib/libedit/eln.c:1.36
--- src/lib/libedit/eln.c:1.35	Fri Apr 26 12:56:57 2019
+++ src/lib/libedit/eln.c	Sun Aug 15 06:08:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $	*/
+/*	$NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.35 2019/04/26 16:56:57 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.36 

CVS commit: src/lib/libedit

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 10:06:32 UTC 2021

Modified Files:
src/lib/libedit: readline.c

Log Message:
Add a LINTED comment... Why doesn't NOTREACHED work?


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/lib/libedit/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.159 src/lib/libedit/readline.c:1.160
--- src/lib/libedit/readline.c:1.159	Wed Oct  9 10:31:07 2019
+++ src/lib/libedit/readline.c	Sun Aug 15 06:06:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.159 2019/10/09 14:31:07 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.159 2019/10/09 14:31:07 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -952,8 +952,10 @@ history_expand(char *str, char **output)
 			(size += len + 1) * sizeof(*nresult));	\
 			if (nresult == NULL) {\
 el_free(*output);			\
-if (/*CONSTCOND*/fr)			\
+if (/*CONSTCOND*/fr) {			\
+	/*LINTED*/			\
 	el_free(tmp);			\
+}	\
 return 0;\
 			}		\
 			result = nresult;\



CVS commit: src/games/fortune/datfiles

2021-08-15 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 15 08:57:01 UTC 2021

Modified Files:
src/games/fortune/datfiles: netbsd-tips

Log Message:
Capitalization police.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/fortune/datfiles/netbsd-tips

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

Modified files:

Index: src/games/fortune/datfiles/netbsd-tips
diff -u src/games/fortune/datfiles/netbsd-tips:1.10 src/games/fortune/datfiles/netbsd-tips:1.11
--- src/games/fortune/datfiles/netbsd-tips:1.10	Fri Jun  4 11:18:31 2021
+++ src/games/fortune/datfiles/netbsd-tips	Sun Aug 15 08:57:01 2021
@@ -120,7 +120,7 @@ and "systat netstat" commands.
 Visit the NetBSD Security website to keep track of advisories:
   http://www.NetBSD.org/support/security/
 Or join the security-announce mailing list for alerts:
-  http://www.netbsd.org/mailinglists/#security-announce
+  http://www.NetBSD.org/mailinglists/#security-announce
 %
 Here's an example of finding what package a file belongs to:
 



CVS commit: src/sys/compat/common

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 07:57:46 UTC 2021

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/common/vfs_syscalls_50.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/compat/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.41 src/sys/compat/common/vfs_syscalls_30.c:1.42
--- src/sys/compat/common/vfs_syscalls_30.c:1.41	Fri Jan 31 04:01:23 2020
+++ src/sys/compat/common/vfs_syscalls_30.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 
-static void cvtstat(struct stat13 *, const struct stat *);
-
 static const struct syscall_package vfs_syscalls_30_syscalls[] = {
 	{ SYS_compat_30___fhstat30, 0, (sy_call_t *)compat_30_sys___fhstat30 },
 	{ SYS_compat_30___fstat13, 0, (sy_call_t *)compat_30_sys___fstat13 },
@@ -85,6 +83,8 @@ static void
 cvtstat(struct stat13 *ost, const struct stat *st)
 {
 
+	/* Handle any padding. */
+	memset(ost, 0, sizeof(*ost));
 	ost->st_dev = st->st_dev;
 	ost->st_ino = (uint32_t)st->st_ino;
 	ost->st_mode = st->st_mode;
@@ -123,8 +123,7 @@ compat_30_sys___stat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 
@@ -148,8 +147,7 @@ compat_30_sys___lstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 /* ARGSUSED */
@@ -164,34 +162,12 @@ compat_30_sys_fhstat(struct lwp *l,
 	struct stat sb;
 	struct stat13 osb;
 	int error;
-	struct compat_30_fhandle fh;
-	struct mount *mp;
-	struct vnode *vp;
-
-	/*
-	 * Must be super user
-	 */
-	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
-	0, NULL, NULL, NULL)))
-		return (error);
 
-	if ((error = copyin(SCARG(uap, fhp), , sizeof(fh))) != 0)
-		return (error);
-
-	if ((mp = vfs_getvfs(_fsid)) == NULL)
-		return (ESTALE);
-	if (mp->mnt_op->vfs_fhtovp == NULL)
-		return EOPNOTSUPP;
-	error = VFS_FHTOVP(mp, (struct fid*)_fid, LK_EXCLUSIVE, );
-	if (error != 0)
-		return (error);
-	error = vn_stat(vp, );
-	vput(vp);
+	error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), );
 	if (error)
-		return (error);
+		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof(osb));
-	return (error);
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -214,8 +190,7 @@ compat_30_sys___fstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -292,7 +267,7 @@ again:
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
 		if (reclen & _DIRENT_ALIGN(bdp))
-			panic("netbsd30_getdents: bad reclen %d", reclen);
+			panic("%s: bad reclen %d", __func__, reclen);
 		if (cookie)
 			off = *cookie++; /* each entry points to the next */
 		else
@@ -396,9 +371,8 @@ compat_30_sys_getfh(struct lwp *l, const
 		error = EINVAL;
 	}
 	if (error)
-		return (error);
-	error = copyout(, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
-	return (error);
+		return error;
+	return copyout(, SCARG(uap, fhp), sizeof(fh));
 }
 
 /*
@@ -437,8 +411,7 @@ compat_30_sys___fhstat30(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap_30, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap_30, sb), sizeof(osb));
 }
 
 /* ARGSUSED */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.66 src/sys/compat/common/vfs_syscalls_43.c:1.67
--- src/sys/compat/common/vfs_syscalls_43.c:1.66	Wed Jun 24 06:28:16 2020
+++ src/sys/compat/common/vfs_syscalls_43.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.66 

CVS commit: src/include

2021-08-14 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Aug 15 00:36:11 UTC 2021

Modified Files:
src/include: utmpx.h

Log Message:
utmpx.h: fix comment missed in r. 1.10 _NETBSD_SOURCE changes


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/include/utmpx.h

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

Modified files:

Index: src/include/utmpx.h
diff -u src/include/utmpx.h:1.17 src/include/utmpx.h:1.18
--- src/include/utmpx.h:1.17	Sun Jan 11 19:09:29 2009
+++ src/include/utmpx.h	Sun Aug 15 00:36:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: utmpx.h,v 1.17 2009/01/11 19:09:29 christos Exp $	 */
+/*	$NetBSD: utmpx.h,v 1.18 2021/08/15 00:36:11 gutteridge Exp $	 */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@ struct lastlogx {
 	char ll_host[_UTX_HOSTSIZE];	/* host name */
 	struct sockaddr_storage ll_ss;	/* address where entry was made from */
 };
-#endif	/* !_XOPEN_SOURCE */
+#endif	/* _NETBSD_SOURCE */
 
 __BEGIN_DECLS
 



CVS commit: src/doc

2021-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 14 23:56:32 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
note some things i've done lately:

- efiboot / libsa gained bi-endian / raidframe
- evbarm boot -d
- GCC and GMP updates


To generate a diff of this commit:
cvs rdiff -u -r1.2820 -r1.2821 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2820 src/doc/CHANGES:1.2821
--- src/doc/CHANGES:1.2820	Sat Aug 14 16:20:31 2021
+++ src/doc/CHANGES	Sat Aug 14 23:56:32 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2820 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2821 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -317,6 +317,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	acpicpu(4): Add support for Arm CPUs. [jmcneill 20201207]
 	OpenSSL: Imported 1.1.1i. [christos 20201209]
 	pkg_install: Updated to 20201212. [wiz 20201212]
+	evbarm: Support "boot -d" for early DDB access. [mrg 20201219]
 	sparc64: Add environment monitoring for the E250 [jdc 20201223]
 	sti(4), hp300: Add bitmap access ops support for SGC CRX (A1659-66001)
 		framebuffer for HP9000/425t. [tsutsui 20201223]
@@ -378,15 +379,20 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	raid(4): Add support for swapped-endian autoconfiguration.
 		[mrg 20210525]
 	dhcp: Import version 4.4.2-P1. [christos 20210526]
-	mips: Switch to GCC 10.  [mrg 20210526]
-	i386: Switch to GCC 10.  [mrg 20210526]
+	libsa: Add support for other-endian FFS volumes. [mrg 20210526]
+	efiboot: Add support for other-endian FFS and booting from RAIDframe
+		volumes. [mrg 20210526]
+	mips: Switch to GCC 10. [mrg 20210526]
+	i386: Switch to GCC 10. [mrg 20210526]
+	arm: Remove support for building the old ABI (oabi). [christos 20210607]
 	libfido2: Import 1.7.0 [christos 20210616]
-	m68k: Switch to GCC 10.  [mrg 20210619]
-	arm: Switch to GCC 10.  [mrg 20210619]
+	m68k: Switch to GCC 10. [mrg 20210619]
+	arm: Switch to GCC 10. [mrg 20210619]
 	uscanner(4): Removed from the tree. [nia 20210629]
 	acpi(4): Updated ACPICA to 20210604. [christos 20210706]
 	hp300: Add support of multiple rd(4) disks on all punits for HPDisk.
 		[tsutsui 20210709]
+	GMP: Import 6.2.1 [mrg 20210711]
 	kernel: Tie the maximum file lock per unprivilegied uid to 
 		kern.maxfiles [manu 20210727]
 	evbppc: Switch ibm4xx to generic evbppc kernel modules. [rin 20210803]



CVS commit: src/sys/kern

2021-08-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 14 21:17:11 UTC 2021

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

Log Message:
fix rumpkernel build failure


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/kern_clock.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/kern_clock.c
diff -u src/sys/kern/kern_clock.c:1.145 src/sys/kern/kern_clock.c:1.146
--- src/sys/kern/kern_clock.c:1.145	Sat Aug 14 17:51:20 2021
+++ src/sys/kern/kern_clock.c	Sat Aug 14 21:17:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.145 2021/08/14 17:51:20 ryo Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.146 2021/08/14 21:17:11 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.145 2021/08/14 17:51:20 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.146 2021/08/14 21:17:11 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dtrace.h"
@@ -457,7 +457,7 @@ statclock(struct clockframe *frame)
 		/*
 		 * Kernel statistics are just like addupc_intr, only easier.
 		 */
-#ifdef MULTIPROCESSOR
+#if defined(MULTIPROCESSOR) && !defined(_RUMPKERNEL)
 		g = curcpu()->ci_gmon;
 		if (g != NULL &&
 		profsrc == PROFSRC_CLOCK && g->state == GMON_PROF_ON) {



CVS commit: src/sys/opencrypto

2021-08-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Aug 14 20:43:05 UTC 2021

Modified Files:
src/sys/opencrypto: crypto.c cryptodev.h

Log Message:
fix typo in CRK_ALGORITHM_MIN definition to match CRK_ALGORITHM_MAX one.
while here fix few typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/opencrypto/crypto.c
cvs rdiff -u -r1.41 -r1.42 src/sys/opencrypto/cryptodev.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/opencrypto/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.115 src/sys/opencrypto/crypto.c:1.116
--- src/sys/opencrypto/crypto.c:1.115	Mon Aug  9 19:57:58 2021
+++ src/sys/opencrypto/crypto.c	Sat Aug 14 20:43:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.115 2021/08/09 19:57:58 andvar Exp $ */
+/*	$NetBSD: crypto.c,v 1.116 2021/08/14 20:43:05 andvar Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.115 2021/08/09 19:57:58 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.116 2021/08/14 20:43:05 andvar Exp $");
 
 #include 
 #include 
@@ -1047,7 +1047,7 @@ crypto_kregister(u_int32_t driverid, int
 
 	cap = crypto_checkdriver_lock(driverid);
 	if (cap != NULL &&
-	(CRK_ALGORITM_MIN <= kalg && kalg <= CRK_ALGORITHM_MAX)) {
+	(CRK_ALGORITHM_MIN <= kalg && kalg <= CRK_ALGORITHM_MAX)) {
 		/*
 		 * XXX Do some performance testing to determine placing.
 		 * XXX We probably need an auxiliary data structure that

Index: src/sys/opencrypto/cryptodev.h
diff -u src/sys/opencrypto/cryptodev.h:1.41 src/sys/opencrypto/cryptodev.h:1.42
--- src/sys/opencrypto/cryptodev.h:1.41	Mon Aug  9 19:57:58 2021
+++ src/sys/opencrypto/cryptodev.h	Sat Aug 14 20:43:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.h,v 1.41 2021/08/09 19:57:58 andvar Exp $ */
+/*	$NetBSD: cryptodev.h,v 1.42 2021/08/14 20:43:05 andvar Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.2.2.6 2003/07/02 17:04:50 sam Exp $	*/
 /*	$OpenBSD: cryptodev.h,v 1.33 2002/07/17 23:52:39 art Exp $	*/
 
@@ -325,7 +325,7 @@ struct cryptret {
 
 
 /* Asymmetric key operations */
-#define	CRK_ALGORITM_MIN	0
+#define	CRK_ALGORITHM_MIN	0
 #define CRK_MOD_EXP		0
 #define CRK_MOD_EXP_CRT		1
 #define CRK_DSA_SIGN		2
@@ -402,7 +402,7 @@ struct cryptostats {
 	 * accumulate statistics about how long it takes to process
 	 * crypto requests at various points during processing.
 	 */
-	struct cryptotstat cs_invoke;	/* crypto_dipsatch -> crypto_invoke */
+	struct cryptotstat cs_invoke;	/* crypto_dispatch -> crypto_invoke */
 	struct cryptotstat cs_done;	/* crypto_invoke -> crypto_done */
 	struct cryptotstat cs_cb;	/* crypto_done -> callback */
 	struct cryptotstat cs_finis;	/* callback -> callback return */
@@ -636,8 +636,8 @@ extern	int crypto_devallowsoft;	/* only 
 /*
  * initialize the crypto framework subsystem (not the pseudo-device).
  * This must be called very early in boot, so the framework is ready
- * to handle registration requests when crpto hardware is autoconfigured.
- * (This declaration doesnt really belong here but there's no header
+ * to handle registration requests when crypto hardware is autoconfigured.
+ * (This declaration doesn't really belong here but there's no header
  * for the raw framework.)
  */
 int	crypto_init(void);



CVS commit: src

2021-08-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 14 17:51:20 UTC 2021

Modified Files:
src/common/lib/libc/gmon: mcount.c
src/sys/arch/aarch64/include: cpu.h
src/sys/arch/alpha/include: cpu.h
src/sys/arch/arm/include: cpu.h
src/sys/arch/hppa/include: cpu.h
src/sys/arch/mips/include: cpu.h
src/sys/arch/or1k/include: cpu.h
src/sys/arch/powerpc/include: cpu.h
src/sys/arch/riscv/include: cpu.h
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sparc64/include: cpu.h
src/sys/arch/vax/include: cpu.h
src/sys/arch/x86/include: cpu.h
src/sys/kern: kern_clock.c subr_prof.c
src/sys/sys: gmon.h
src/usr.sbin/kgmon: kgmon.8 kgmon.c

Log Message:
Improved the performance of kernel profiling on MULTIPROCESSOR, and possible to 
get profiling data for each CPU.

In the current implementation, locks are acquired at the entrance of the mcount
internal function, so the higher the number of cores, the more lock conflict
occurs, making profiling performance in a MULTIPROCESSOR environment unusable
and slow. Profiling buffers has been changed to be reserved for each CPU,
improving profiling performance in MP by several to several dozen times.

- Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers.
- Add ci_gmon member to struct cpu_info of each MP arch.
- Add kern.profiling.percpu node in sysctl tree.
- Add new -c  option to kgmon(8) to specify the cpuid, like openbsd.
  For compatibility, if the -c option is not specified, the entire system can be
  operated as before, and the -p option will get the total profiling data for
  all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/common/lib/libc/gmon/mcount.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/alpha/include/cpu.h
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/include/cpu.h
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/or1k/include/cpu.h
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/include/cpu.h
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/sparc64/include/cpu.h
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.144 -r1.145 src/sys/kern/kern_clock.c
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/subr_prof.c
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/gmon.h
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/kgmon/kgmon.8
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/kgmon/kgmon.c

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

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.15 src/common/lib/libc/gmon/mcount.c:1.16
--- src/common/lib/libc/gmon/mcount.c:1.15	Sat Aug 14 17:38:44 2021
+++ src/common/lib/libc/gmon/mcount.c	Sat Aug 14 17:51:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $	*/
+/*	$NetBSD: mcount.c,v 1.16 2021/08/14 17:51:18 ryo Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,13 +76,14 @@
 #if 0
 static char sccsid[] = "@(#)mcount.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.16 2021/08/14 17:51:18 ryo Exp $");
 #endif
 #endif
 
 #include 
 #include 
 #include 
+#include 
 
 #ifndef _KERNEL
 #include "reentrant.h"
@@ -94,10 +95,6 @@ extern struct gmonparam _gmondummy;
 struct gmonparam *_m_gmon_alloc(void);
 #endif
 
-#if defined(_KERNEL) && !defined(_RUMPKERNEL) && defined(MULTIPROCESSOR)
-__cpu_simple_lock_t __mcount_lock;
-#endif
-
 #ifndef __LINT__
 _MCOUNT_DECL(u_long, u_long)
 #ifdef _KERNEL
@@ -168,8 +165,11 @@ _MCOUNT_DECL(u_long frompc, u_long selfp
 #if defined(_KERNEL) && !defined(_RUMPKERNEL)
 	MCOUNT_ENTER;
 #ifdef MULTIPROCESSOR
-	__cpu_simple_lock(&__mcount_lock);
-	__insn_barrier();
+	p = curcpu()->ci_gmon;
+	if (p == NULL || p->state != GMON_PROF_ON) {
+		MCOUNT_EXIT;
+		return;
+	}
 #endif
 #endif
 	p->state = GMON_PROF_BUSY;
@@ -264,10 +264,6 @@ _MCOUNT_DECL(u_long frompc, u_long selfp
 done:
 	p->state = GMON_PROF_ON;
 #if defined(_KERNEL) && !defined(_RUMPKERNEL)
-#ifdef MULTIPROCESSOR
-	__insn_barrier();
-	__cpu_simple_unlock(&__mcount_lock);
-#endif
 	MCOUNT_EXIT;
 #endif
 	return;
@@ -275,10 +271,6 @@ done:
 overflow:
 	p->state = GMON_PROF_ERROR;
 #if defined(_KERNEL) && !defined(_RUMPKERNEL)
-#ifdef MULTIPROCESSOR
-	__insn_barrier();
-	__cpu_simple_unlock(&__mcount_lock);
-#endif
 	MCOUNT_EXIT;
 #endif
 	return;
@@ -293,4 +285,106 @@ overflow:
 MCOUNT
 #endif
 
+#if defined(_KERNEL) && !defined(_RUMPKERNEL) && defined(MULTIPROCESSOR)
+void 

CVS commit: src/common/lib/libc/gmon

2021-08-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 14 17:38:44 UTC 2021

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
don't include "opt_multiprocessor.h" inside an ifdef to work "make depend" 
properly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/common/lib/libc/gmon/mcount.c

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

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.14 src/common/lib/libc/gmon/mcount.c:1.15
--- src/common/lib/libc/gmon/mcount.c:1.14	Tue Aug 27 22:48:53 2019
+++ src/common/lib/libc/gmon/mcount.c	Sat Aug 14 17:38:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.14 2019/08/27 22:48:53 kamil Exp $	*/
+/*	$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -64,19 +64,19 @@
  * SUCH DAMAGE.
  */
 
-/* If building a standalone libkern, don't include mcount. */
-#if (!defined(_KERNEL) || defined(GPROF)) && !defined(_STANDALONE)
-
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
 #endif
 
+/* If building a standalone libkern, don't include mcount. */
+#if (!defined(_KERNEL) || defined(GPROF)) && !defined(_STANDALONE)
+
 #include 
 #if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS)
 #if 0
 static char sccsid[] = "@(#)mcount.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mcount.c,v 1.14 2019/08/27 22:48:53 kamil Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $");
 #endif
 #endif
 



CVS commit: src/usr.sbin/racoon

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 17:08:21 UTC 2021

Modified Files:
src/usr.sbin/racoon: Makefile

Log Message:
One more ldap change


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/racoon/Makefile

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/racoon/Makefile
diff -u src/usr.sbin/racoon/Makefile:1.39 src/usr.sbin/racoon/Makefile:1.40
--- src/usr.sbin/racoon/Makefile:1.39	Mon Apr 12 21:11:05 2021
+++ src/usr.sbin/racoon/Makefile	Sat Aug 14 13:08:21 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2021/04/13 01:11:05 mrg Exp $
+# $NetBSD: Makefile,v 1.40 2021/08/14 17:08:21 christos Exp $
 
 WARNS?=	0	# XXX third-party program, many issues
 NOCLANGERROR=	# defined
@@ -60,8 +60,8 @@ CPPFLAGS+=-DINET6
 
 .if (${USE_LDAP} != "no")
 CPPFLAGS+=-DHAVE_LIBLDAP
-LDADD+=-lldap -llber -lssl
-DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBSSL}
+LDADD+= ${LIBLDAP_LDADD}
+DPADD+= ${LIBLDAP_DPADD}
 .endif
 
 LDADD+= -lcrypto -lcrypt



CVS commit: src/doc

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:20:31 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenLDAP


To generate a diff of this commit:
cvs rdiff -u -r1.1809 -r1.1810 src/doc/3RDPARTY
cvs rdiff -u -r1.2819 -r1.2820 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1809 src/doc/3RDPARTY:1.1810
--- src/doc/3RDPARTY:1.1809	Thu Jul 29 09:42:38 2021
+++ src/doc/3RDPARTY	Sat Aug 14 12:20:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1809 2021/07/29 13:42:38 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1810 2021/08/14 16:20:31 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1017,12 +1017,12 @@ Notes:
 We have lots of local fixes.
 
 Package:	OpenLDAP
-Version:	2.4.50
-Current Vers:	2.4.57
+Version:	2.5.6
+Current Vers:	2.5.6
 Maintainer:	OpenLDAP Foundation
 Archive Site:	http://www.openldap.org/
 Home Page:	http://www.openldap.org/
-Date:		2021-03-01
+Date:		2021-08-14
 Mailing List:
 Responsible:
 License:	BSD (3-clause)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2819 src/doc/CHANGES:1.2820
--- src/doc/CHANGES:1.2819	Tue Aug 10 12:45:35 2021
+++ src/doc/CHANGES	Sat Aug 14 12:20:31 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2819 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2820 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -399,3 +399,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbarm: Improvements in interrupt handling on Arm GIC v2 and v3 systems
 		resulting in better network and storage performance.
 		[jmcneill 20210810]
+	openldap: Import 2.5.6. [christos 20210814]



CVS commit: src/distrib/sets/lists

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:18:32 UTC 2021

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump ldap libraries


To generate a diff of this commit:
cvs rdiff -u -r1.922 -r1.923 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.279 -r1.280 src/distrib/sets/lists/debug/shl.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/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.922 src/distrib/sets/lists/base/shl.mi:1.923
--- src/distrib/sets/lists/base/shl.mi:1.922	Tue Jul 13 23:19:23 2021
+++ src/distrib/sets/lists/base/shl.mi	Sat Aug 14 12:18:32 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.922 2021/07/14 03:19:23 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.923 2021/08/14 16:18:32 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -417,14 +417,14 @@
 ./usr/lib/libkvm.so.6base-sys-shlib		compatfile
 ./usr/lib/libkvm.so.6.0base-sys-shlib		compatfile
 ./usr/lib/liblber.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/liblber.so.3base-ldap-shlib		ldap,compatfile
-./usr/lib/liblber.so.3.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/liblber.so.5base-ldap-shlib		ldap,compatfile
+./usr/lib/liblber.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/libldap.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/libldap.so.4base-ldap-shlib		ldap,compatfile
-./usr/lib/libldap.so.4.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap.so.5base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/libldap_r.sobase-ldap-shlib		ldap,compatfile
-./usr/lib/libldap_r.so.4			base-ldap-shlib		ldap,compatfile
-./usr/lib/libldap_r.so.4.3			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap_r.so.5			base-ldap-shlib		ldap,compatfile
+./usr/lib/libldap_r.so.5.0			base-ldap-shlib		ldap,compatfile
 ./usr/lib/liblsan.sobase-sys-shlib		compatfile,cxx,gcc
 ./usr/lib/liblsan.so.1base-sys-shlib		compatfile,obsolete
 ./usr/lib/liblsan.so.1.0			base-sys-shlib		compatfile,obsolete

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.279 src/distrib/sets/lists/debug/shl.mi:1.280
--- src/distrib/sets/lists/debug/shl.mi:1.279	Tue Jul 13 23:19:24 2021
+++ src/distrib/sets/lists/debug/shl.mi	Sat Aug 14 12:18:32 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.279 2021/07/14 03:19:24 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.280 2021/08/14 16:18:32 christos Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
@@ -148,9 +148,9 @@
 ./usr/libdata/debug/usr/lib/libkdc.so.3.0.debug			comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libkrb5.so.27.0.debug		comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libkvm.so.6.0.debug			comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/liblber.so.3.3.debug		comp-ldap-debug	debug,compatfile,ldap
-./usr/libdata/debug/usr/lib/libldap.so.4.3.debug		comp-ldap-debug	debug,compatfile,ldap
-./usr/libdata/debug/usr/lib/libldap_r.so.4.3.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/liblber.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/libldap.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
+./usr/libdata/debug/usr/lib/libldap_r.so.5.0.debug		comp-ldap-debug	debug,compatfile,ldap
 ./usr/libdata/debug/usr/lib/liblsan.so.1.0.debug		comp-sys-debug	debug,compatfile,obsolete
 ./usr/libdata/debug/usr/lib/liblsan.so.2.0.debug		comp-sys-debug	debug,compatfile,cxx,gcc
 ./usr/libdata/debug/usr/lib/liblua.so.5.3.debug			comp-sys-debug	debug,compatfile



CVS commit: src

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:17:57 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/dist: ldapauth.c ldapauth.h sshd.c
src/external/bsd/am-utils/bin/amd: Makefile
src/external/ibm-public/postfix: Makefile.inc

Log Message:
Adjust for new OpenLDAP
- use centralized library variables
- ldap_connect -> ldap_xconnect


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/ldapauth.c
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/ldapauth.h
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/openssh/dist/sshd.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/am-utils/bin/amd/Makefile
cvs rdiff -u -r1.27 -r1.28 src/external/ibm-public/postfix/Makefile.inc

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

Modified files:

Index: src/crypto/external/bsd/openssh/bin/sshd/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23 src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.24
--- src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23	Fri Mar  5 12:47:15 2021
+++ src/crypto/external/bsd/openssh/bin/sshd/Makefile	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2021/03/05 17:47:15 christos Exp $
+#	$NetBSD: Makefile,v 1.24 2021/08/14 16:17:57 christos Exp $
 
 .include 
 
@@ -54,8 +54,8 @@ DPADD+= ${LIBKRB5_DPADD}
 
 .if (${USE_LDAP} != "no")
 SRCS+=	ldapauth.c
-LDADD+=	-lldap -lssl -llber
-DPADD+=	${LIBLDAP} ${LIBSSL} ${LIBLBER}
+LDADD+=	${LIBLDAP_LDADD}
+DPADD+=	${LIBLDAP_DPADD}
 .endif
 
 LDADD+=	-lcrypt -lutil

Index: src/crypto/external/bsd/openssh/dist/ldapauth.c
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7 src/crypto/external/bsd/openssh/dist/ldapauth.c:1.8
--- src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -21,7 +21,7 @@
  *
  */
 #include "includes.h"
-__RCSID("$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $");
+__RCSID("$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $");
 
 #ifdef WITH_LDAP_PUBKEY
 #include 
@@ -124,7 +124,7 @@ void ldap_close(ldap_opt_t * ldap) {
 }
 
 /* init && bind */
-int ldap_connect(ldap_opt_t * ldap) {
+int ldap_xconnect(ldap_opt_t * ldap) {
 int version = LDAP_VERSION3;
 
 if (!ldap->servers)
@@ -154,7 +154,7 @@ int ldap_connect(ldap_opt_t * ldap) {
 if ( (ldap->tls == -1) || (ldap->tls == 1) ) {
 if (ldap_start_tls_s(ldap->ld, NULL, NULL ) != LDAP_SUCCESS) {
 /* failed then reinit the initial connect */
-ldap_perror(ldap->ld, "ldap_connect: (TLS) ldap_start_tls()");
+ldap_perror(ldap->ld, "ldap_xconnect: (TLS) ldap_start_tls()");
 if (ldap->tls == 1)
 return FAILURE;
 
@@ -378,7 +378,7 @@ ldap_key_t * ldap_getuserkey(ldap_opt_t 
 /* XXX TODO: setup some conf value for retrying */
 if (!(l->flags & FLAG_CONNECTED))
 for (i = 0 ; i < 2 ; i++)
-if (ldap_connect(l) == 0)
+if (ldap_xconnect(l) == 0)
 break;
 
 /* quick check for attempts to be evil */
@@ -445,7 +445,7 @@ int ldap_ismember(ldap_opt_t * l, const 
 /* XXX TODO: setup some conf value for retrying */
 if (!(l->flags & FLAG_CONNECTED)) 
 for (i = 0 ; i < 2 ; i++)
-if (ldap_connect(l) == 0)
+if (ldap_xconnect(l) == 0)
  break;
 
 /* quick check for attempts to be evil */

Index: src/crypto/external/bsd/openssh/dist/ldapauth.h
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5 src/crypto/external/bsd/openssh/dist/ldapauth.h:1.6
--- src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.h	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.h,v 1.5 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.h,v 1.6 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -112,7 +112,7 @@ typedef struct ldap_keys {
 
 /* function headers */
 void ldap_close(ldap_opt_t *);
-int ldap_connect(ldap_opt_t *);
+int ldap_xconnect(ldap_opt_t *);
 char * ldap_parse_groups(const char *);
 char * ldap_parse_servers(const char *);
 void ldap_options_print(ldap_opt_t *);

Index: src/crypto/external/bsd/openssh/dist/sshd.c
diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.42 src/crypto/external/bsd/openssh/dist/sshd.c:1.43
--- src/crypto/external/bsd/openssh/dist/sshd.c:1.42	Mon Apr 19 10:40:15 2021
+++ src/crypto/external/bsd/openssh/dist/sshd.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 

CVS commit: src/share/mk

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:16:32 UTC 2021

Modified Files:
src/share/mk: bsd.prog.mk

Log Message:
Centralize the ldap libraries


To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.336 src/share/mk/bsd.prog.mk:1.337
--- src/share/mk/bsd.prog.mk:1.336	Thu Nov 12 12:53:43 2020
+++ src/share/mk/bsd.prog.mk	Sat Aug 14 12:16:32 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.336 2020/11/12 17:53:43 nia Exp $
+#	$NetBSD: bsd.prog.mk,v 1.337 2021/08/14 16:16:32 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -229,6 +229,11 @@ LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR}
 	${LIBSQLITE3} ${LIBM} ${LIBCRYPT} ${LIBUTIL}
 .endif
 
+.if (${MKLDAP} != "no")
+LIBLDAP_LDADD+= -lldap -llber -lgssapi -lssl -lcrypto 
+LIBLDAP_DPADD+= ${LIBLDAP} ${LIBLBER} ${LIBGSSAPI} ${LIBSSL} ${LIBCRYPTO}
+.endif
+
 # PAM applications, if linked statically, need more libraries
 .if (${MKPIC} == "no")
 PAM_STATIC_LDADD+= -lssh



CVS commit: src/external/bsd/openldap/dist/libraries/libldap

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:15:46 UTC 2021

Added Files:
src/external/bsd/openldap/dist/libraries/libldap: gssapi.c

Log Message:
Put back gssapi.c


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.4 \
src/external/bsd/openldap/dist/libraries/libldap/gssapi.c

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

Added files:

Index: src/external/bsd/openldap/dist/libraries/libldap/gssapi.c
diff -u /dev/null src/external/bsd/openldap/dist/libraries/libldap/gssapi.c:1.4
--- /dev/null	Sat Aug 14 12:15:46 2021
+++ src/external/bsd/openldap/dist/libraries/libldap/gssapi.c	Sat Aug 14 12:15:46 2021
@@ -0,0 +1,1015 @@
+/*	$NetBSD: gssapi.c,v 1.4 2021/08/14 16:15:46 christos Exp $	*/
+
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2020 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Author: Stefan Metzmacher 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
+ */
+
+#include 
+__RCSID("$NetBSD: gssapi.c,v 1.4 2021/08/14 16:15:46 christos Exp $");
+
+#include "portable.h"
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef HAVE_LIMITS_H
+#include 
+#endif
+
+#include "ldap-int.h"
+
+#ifdef HAVE_GSSAPI
+
+#ifdef HAVE_GSSAPI_GSSAPI_H
+#include 
+#else
+#include 
+#endif
+
+static char *
+gsserrstr(
+	char *buf,
+	ber_len_t buf_len,
+	gss_OID mech,
+	int gss_rc,
+	OM_uint32 minor_status )
+{
+	OM_uint32 min2;
+	gss_buffer_desc mech_msg = GSS_C_EMPTY_BUFFER;
+	gss_buffer_desc gss_msg = GSS_C_EMPTY_BUFFER;
+	gss_buffer_desc minor_msg = GSS_C_EMPTY_BUFFER;
+	OM_uint32 msg_ctx = 0;
+
+	if (buf == NULL) {
+		return NULL;
+	}
+
+	if (buf_len == 0) {
+		return NULL;
+	}
+
+#ifdef HAVE_GSS_OID_TO_STR
+	gss_oid_to_str(, mech, _msg);
+#endif
+	gss_display_status(, gss_rc, GSS_C_GSS_CODE,
+			   mech, _ctx, _msg);
+	gss_display_status(, minor_status, GSS_C_MECH_CODE,
+			   mech, _ctx, _msg);
+
+	snprintf(buf, buf_len, "gss_rc[%d:%*s] mech[%*s] minor[%u:%*s]",
+		 gss_rc, (int)gss_msg.length,
+		 (const char *)(gss_msg.value?gss_msg.value:""),
+		 (int)mech_msg.length,
+		 (const char *)(mech_msg.value?mech_msg.value:""),
+		 minor_status, (int)minor_msg.length,
+		 (const char *)(minor_msg.value?minor_msg.value:""));
+
+	gss_release_buffer(, _msg);
+	gss_release_buffer(, _msg);
+	gss_release_buffer(, _msg);
+
+	buf[buf_len-1] = '\0';
+
+	return buf;
+}
+
+static void
+sb_sasl_gssapi_init(
+	struct sb_sasl_generic_data *p,
+	ber_len_t *min_send,
+	ber_len_t *max_send,
+	ber_len_t *max_recv )
+{
+	gss_ctx_id_t gss_ctx = (gss_ctx_id_t)p->ops_private;
+	int gss_rc;
+	OM_uint32 minor_status;
+	gss_OID ctx_mech = GSS_C_NO_OID;
+	OM_uint32 ctx_flags = 0;
+	int conf_req_flag = 0;
+	OM_uint32 max_input_size;
+
+	gss_inquire_context(_status,
+			gss_ctx,
+			NULL,
+			NULL,
+			NULL,
+			_mech,
+			_flags,
+			NULL,
+			NULL);
+
+	if (ctx_flags & (GSS_C_CONF_FLAG)) {
+		conf_req_flag = 1;
+	}
+
+#if defined(HAVE_CYRUS_SASL)
+#define SEND_PREALLOC_SIZE	SASL_MIN_BUFF_SIZE
+#else
+#define SEND_PREALLOC_SIZE  4096
+#endif
+#define SEND_MAX_WIRE_SIZE	0x00A0
+#define RECV_MAX_WIRE_SIZE	0x0FFF
+#define FALLBACK_SEND_MAX_SIZE	0x009FFFB8 /* from MIT 1.5.x */
+
+	gss_rc = gss_wrap_size_limit(_status, gss_ctx,
+ conf_req_flag, GSS_C_QOP_DEFAULT,
+ SEND_MAX_WIRE_SIZE, _input_size);
+	if ( gss_rc != GSS_S_COMPLETE ) {
+		char msg[256];
+		ber_log_printf( LDAP_DEBUG_ANY, p->sbiod->sbiod_sb->sb_debug,
+"sb_sasl_gssapi_init: failed to wrap size limit: %s\n",
+gsserrstr( msg, sizeof(msg), ctx_mech, gss_rc, minor_status ) );
+		ber_log_printf( LDAP_DEBUG_ANY, p->sbiod->sbiod_sb->sb_debug,
+"sb_sasl_gssapi_init: fallback to default wrap size limit\n");
+		/*
+		 * some libgssglue/libgssapi versions
+		 * have a broken gss_wrap_size_limit()
+		 * implementation
+		 */
+		max_input_size = FALLBACK_SEND_MAX_SIZE;
+	}
+
+	*min_send = SEND_PREALLOC_SIZE;
+	*max_send = max_input_size;
+	*max_recv = RECV_MAX_WIRE_SIZE;
+}
+
+static ber_int_t
+sb_sasl_gssapi_encode(
+	struct sb_sasl_generic_data *p,
+	unsigned char *buf,
+	ber_len_t len,
+	Sockbuf_Buf *dst )
+{
+	gss_ctx_id_t gss_ctx = (gss_ctx_id_t)p->ops_private;
+	int gss_rc;
+	OM_uint32 minor_status;
+	gss_buffer_desc unwrapped, wrapped;
+	gss_OID ctx_mech = GSS_C_NO_OID;
+	OM_uint32 ctx_flags = 0;
+	int conf_req_flag = 0;
+	int conf_state;
+	unsigned char *b;
+	ber_len_t pkt_len;
+
+	unwrapped.value		= buf;
+	unwrapped.length	= len;
+
+	gss_inquire_context(_status,
+			gss_ctx,
+			NULL,
+			

CVS commit: src/external/bsd/openldap

2021-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 14 16:15:04 UTC 2021

Modified Files:
src/external/bsd/openldap: openldap.mk
src/external/bsd/openldap/bin: Makefile.inc
src/external/bsd/openldap/dist/build: mkversion version.h
src/external/bsd/openldap/dist/clients/tools: common.c common.h
ldapcompare.c ldapdelete.c ldapexop.c ldapmodify.c ldapmodrdn.c
ldappasswd.c ldapsearch.c ldapurl.c ldapvc.c ldapwhoami.c
src/external/bsd/openldap/dist/contrib/ldapc++/src: LDAPAddRequest.h
LDAPAsynConnection.h LDAPAttrType.h LDAPAttribute.h
LDAPAttributeList.h LDAPBindRequest.h LDAPCompareRequest.h
LDAPConnection.h LDAPConstraints.h LDAPControl.h LDAPControlSet.h
LDAPDeleteRequest.h LDAPEntry.h LDAPEntryList.h LDAPException.h
LDAPExtRequest.h LDAPExtResult.h LDAPMessage.h LDAPMessageQueue.h
LDAPModDNRequest.h LDAPModList.h LDAPModification.h
LDAPModifyRequest.h LDAPObjClass.h LDAPRebind.h LDAPRebindAuth.h
LDAPReferenceList.h LDAPRequest.h LDAPResult.h LDAPSaslBindResult.h
LDAPSchema.h LDAPSearchReference.h LDAPSearchRequest.h
LDAPSearchResult.h LDAPSearchResults.h LDAPUrl.h LDAPUrlList.h
LdifReader.h LdifWriter.h SaslInteraction.h
SaslInteractionHandler.h StringList.h TlsOptions.h debug.h
src/external/bsd/openldap/dist/contrib/ldapc++/src/ac: time.h
src/external/bsd/openldap/dist/contrib/ldaptcl: neoXldap.c tclAppInit.c
tkAppInit.c
src/external/bsd/openldap/dist/contrib/slapd-modules/acl: gssacl.c
posixgroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/addpartial:
addpartial-overlay.c
src/external/bsd/openldap/dist/contrib/slapd-modules/adremap: adremap.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allop: allop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allowed: allowed.c
src/external/bsd/openldap/dist/contrib/slapd-modules/authzid: authzid.c
src/external/bsd/openldap/dist/contrib/slapd-modules/autogroup:
autogroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/cloak: cloak.c
src/external/bsd/openldap/dist/contrib/slapd-modules/comp_match: asn.h
asn_to_syn_mr.c authorityKeyIdentifier.c authorityKeyIdentifier.h
certificate.c certificate.h componentlib.c componentlib.h crl.c
crl.h init.c
src/external/bsd/openldap/dist/contrib/slapd-modules/datamorph:
datamorph.c
src/external/bsd/openldap/dist/contrib/slapd-modules/denyop: denyop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dsaschema:
dsaschema.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dupent: dupent.c
src/external/bsd/openldap/dist/contrib/slapd-modules/kinit: kinit.c
src/external/bsd/openldap/dist/contrib/slapd-modules/lastbind:
lastbind.c
src/external/bsd/openldap/dist/contrib/slapd-modules/lastmod: lastmod.c
src/external/bsd/openldap/dist/contrib/slapd-modules/noopsrch:
noopsrch.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nops: nops.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nssov: alias.c
ether.c group.c host.c netgroup.c network.c nssov.c nssov.h pam.c
passwd.c protocol.c rpc.c service.c shadow.c

src/external/bsd/openldap/dist/contrib/slapd-modules/nssov/nss-pam-ldapd:
attrs.h nslcd-prot.h nslcd.h tio.c tio.h
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd: apr1.c
kerberos.c netscape.c radius.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/pbkdf2:
pw-pbkdf2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/sha2:
sha2.c sha2.h slapd-sha2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/totp:
slapd-totp.c
src/external/bsd/openldap/dist/contrib/slapd-modules/ppm: ppm.c ppm.h
ppm_test.c
src/external/bsd/openldap/dist/contrib/slapd-modules/proxyOld:
proxyOld.c
src/external/bsd/openldap/dist/contrib/slapd-modules/rbac: init.c jts.c
ldap_rbac.h rbac.c rbac.h rbacacl.c rbacaudit.c rbacperm.c
rbacreq.c rbacsess.c rbacuser.c util.c
src/external/bsd/openldap/dist/contrib/slapd-modules/samba4: pguid.c
rdnval.c vernum.c
src/external/bsd/openldap/dist/contrib/slapd-modules/smbk5pwd:
smbk5pwd.c
src/external/bsd/openldap/dist/contrib/slapd-modules/trace: trace.c
src/external/bsd/openldap/dist/contrib/slapd-modules/usn: usn.c
src/external/bsd/openldap/dist/contrib/slapd-modules/variant: variant.c
src/external/bsd/openldap/dist/contrib/slapd-modules/vc: vc.c

CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 14:43:30 UTC 2021

Modified Files:
src/usr.bin/make: arch.c

Log Message:
make: add ARGSUSED for lint


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/make/arch.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.201 src/usr.bin/make/arch.c:1.202
--- src/usr.bin/make/arch.c:1.201	Sat Aug 14 13:26:07 2021
+++ src/usr.bin/make/arch.c	Sat Aug 14 14:43:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.201 2021/08/14 13:26:07 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.202 2021/08/14 14:43:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.201 2021/08/14 13:26:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.202 2021/08/14 14:43:30 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -988,6 +988,7 @@ Arch_FindLib(GNode *gn, SearchPath *path
 #endif
 }
 
+/* ARGSUSED */
 static bool
 RanlibOODate(const GNode *gn MAKE_ATTR_UNUSED)
 {



CVS commit: src/tests/usr.bin/xlint/lint2

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 14:25:51 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: msg_008.exp msg_008.ln msg_009.exp
msg_009.ln msg_010.exp msg_010.ln

Log Message:
tests/lint: add tests for messages 8, 9 and 10


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_008.exp \
src/tests/usr.bin/xlint/lint2/msg_008.ln \
src/tests/usr.bin/xlint/lint2/msg_009.exp \
src/tests/usr.bin/xlint/lint2/msg_009.ln \
src/tests/usr.bin/xlint/lint2/msg_010.exp \
src/tests/usr.bin/xlint/lint2/msg_010.ln

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

Modified files:

Index: src/tests/usr.bin/xlint/lint2/msg_008.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_008.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_008.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func returns value which is always ignored
Index: src/tests/usr.bin/xlint/lint2/msg_008.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_008.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_008.ln	Sat Aug 14 14:25:51 2021
@@ -1,6 +1,16 @@
-# $NetBSD: msg_008.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_008.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 8 of lint2:
 #	%s returns value which is always ignored
 #
-# TODO: add actual test data
+
+0smsg_008.c
+Smsg_008.c
+
+# 100: bool func(void) { return true }
+100 d 0.100 drs 4func F0 B
+
+# 110: func();
+110 c 0.110 i 4func f0 B
+# 111: func();
+111 c 0.111 i 4func f0 B
Index: src/tests/usr.bin/xlint/lint2/msg_009.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_009.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_009.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func returns value which is sometimes ignored
Index: src/tests/usr.bin/xlint/lint2/msg_009.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_009.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_009.ln	Sat Aug 14 14:25:51 2021
@@ -1,6 +1,16 @@
-# $NetBSD: msg_009.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_009.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 9 of lint2:
 #	%s returns value which is sometimes ignored
 #
-# TODO: add actual test data
+
+0smsg_009.c
+Smsg_009.c
+
+# 100: bool func(void) { return true }
+100 d 0.100 drs 4func F0 B
+
+# 110: var = func();
+110 c 0.110 u 4func f0 B
+# 111: func();
+111 c 0.111 i 4func f0 B
Index: src/tests/usr.bin/xlint/lint2/msg_010.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_010.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_010.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func value is used( msg_010.c?(30) ), but none returned
Index: src/tests/usr.bin/xlint/lint2/msg_010.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_010.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_010.ln	Sat Aug 14 14:25:51 2021
@@ -1,6 +1,17 @@
-# $NetBSD: msg_010.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_010.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 10 of lint2:
 #	%s value is used( %s ), but none returned
 #
-# TODO: add actual test data
+
+0 s msg_010.c
+S msg_010.c
+1 s msg_010_use.c
+
+# msg_010.c:10: func() {}
+10 d 0.10 d o 4func f0I
+
+# msg_010_use.c:20: func();
+20 d 1.20 e 4func F I
+# msg_010_use.c:30: use() { return func(); }
+30 c 1.30 u 4func f 0 I



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:39:43 UTC 2021

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make: fix spelling of CVS and RCS in error message


To generate a diff of this commit:
cvs rdiff -u -r1.562 -r1.563 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.562 src/usr.bin/make/parse.c:1.563
--- src/usr.bin/make/parse.c:1.562	Sat Aug 14 13:37:55 2021
+++ src/usr.bin/make/parse.c	Sat Aug 14 13:39:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.562 2021/08/14 13:37:55 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.563 2021/08/14 13:39:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.562 2021/08/14 13:37:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.563 2021/08/14 13:39:43 rillig Exp $");
 
 /* types and constants */
 
@@ -1004,7 +1004,7 @@ ParseErrorNoDependency(const char *lstar
 	(strncmp(lstart, "==", 6) == 0) ||
 	(strncmp(lstart, ">>", 6) == 0))
 		Parse_Error(PARSE_FATAL,
-		"Makefile appears to contain unresolved cvs/rcs/??? merge conflicts");
+		"Makefile appears to contain unresolved CVS/RCS/??? merge conflicts");
 	else if (lstart[0] == '.') {
 		const char *dirstart = lstart + 1;
 		const char *dirend;



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:37:56 UTC 2021

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make: rename ParseMark to be more expressive

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.561 -r1.562 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.561 src/usr.bin/make/parse.c:1.562
--- src/usr.bin/make/parse.c:1.561	Sat Aug 14 13:32:12 2021
+++ src/usr.bin/make/parse.c	Sat Aug 14 13:37:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.561 2021/08/14 13:32:12 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.562 2021/08/14 13:37:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.561 2021/08/14 13:32:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.562 2021/08/14 13:37:55 rillig Exp $");
 
 /* types and constants */
 
@@ -530,7 +530,7 @@ ParseIsEscaped(const char *line, const c
  * was first defined.
  */
 static void
-ParseMark(GNode *gn)
+RememberLocation(GNode *gn)
 {
 	IFile *curFile = CurFile();
 	gn->fname = curFile->fname;
@@ -782,7 +782,7 @@ TryApplyDependencyOperator(GNode *gn, GN
 
 		cohort = Targ_NewInternalNode(gn->name);
 		if (doing_depend)
-			ParseMark(cohort);
+			RememberLocation(cohort);
 		/*
 		 * Make the cohort invisible as well to avoid duplicating it
 		 * into other variables. True, parents of this target won't
@@ -837,7 +837,7 @@ ParseDependencySourceWait(bool isSpecial
 	snprintf(wait_src, sizeof wait_src, ".WAIT_%u", ++wait_number);
 	gn = Targ_NewInternalNode(wait_src);
 	if (doing_depend)
-		ParseMark(gn);
+		RememberLocation(gn);
 	gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN;
 	LinkToTargets(gn, isSpecial);
 
@@ -897,7 +897,7 @@ ParseDependencySourceOrder(const char *s
 	 */
 	gn = Targ_GetNode(src);
 	if (doing_depend)
-		ParseMark(gn);
+		RememberLocation(gn);
 	if (order_pred != NULL) {
 		Lst_Append(_pred->order_succ, gn);
 		Lst_Append(>order_pred, order_pred);
@@ -934,7 +934,7 @@ ParseDependencySourceOther(const char *s
 	/* Find/create the 'src' node and attach to all targets */
 	gn = Targ_GetNode(src);
 	if (doing_depend)
-		ParseMark(gn);
+		RememberLocation(gn);
 	if (tOp != OP_NONE)
 		gn->type |= tOp;
 	else
@@ -1085,7 +1085,7 @@ ParseDependencyTargetSpecial(ParseSpecia
 	case SP_INTERRUPT: {
 		GNode *gn = Targ_GetNode(targetName);
 		if (doing_depend)
-			ParseMark(gn);
+			RememberLocation(gn);
 		gn->type |= OP_NOTMAIN | OP_SPECIAL;
 		Lst_Append(targets, gn);
 		break;
@@ -1215,7 +1215,7 @@ ParseDependencyTargetMundane(char *targe
 		? Suff_AddTransform(targName)
 		: Targ_GetNode(targName);
 		if (doing_depend)
-			ParseMark(gn);
+			RememberLocation(gn);
 
 		Lst_Append(targets, gn);
 	}
@@ -2084,7 +2084,7 @@ ParseAddCmd(GNode *gn, char *cmd)
 		Lst_Append(>commands, cmd);
 		if (MaybeSubMake(cmd))
 			gn->type |= OP_SUBMAKE;
-		ParseMark(gn);
+		RememberLocation(gn);
 	} else {
 #if 0
 		/* XXX: We cannot do this until we fix the tree */



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:32:12 UTC 2021

Modified Files:
src/usr.bin/make: main.c nonints.h parse.c

Log Message:
make: rename variable and function for handling parse errors

The word 'fatals' was an unnecessary abbreviation.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.540 -r1.541 src/usr.bin/make/main.c
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.560 -r1.561 src/usr.bin/make/parse.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/make/main.c
diff -u src/usr.bin/make/main.c:1.540 src/usr.bin/make/main.c:1.541
--- src/usr.bin/make/main.c:1.540	Fri Jun 18 12:54:17 2021
+++ src/usr.bin/make/main.c	Sat Aug 14 13:32:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.540 2021/06/18 12:54:17 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.541 2021/08/14 13:32:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.540 2021/06/18 12:54:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.541 2021/08/14 13:32:12 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1658,7 +1658,7 @@ main_CleanUp(void)
 static int
 main_Exit(bool outOfDate)
 {
-	if (opts.strict && (main_errors > 0 || Parse_GetFatals() > 0))
+	if (opts.strict && (main_errors > 0 || Parse_NumErrors() > 0))
 		return 2;	/* Not 1 so -q can distinguish error */
 	return outOfDate ? 1 : 0;
 }

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.213 src/usr.bin/make/nonints.h:1.214
--- src/usr.bin/make/nonints.h:1.213	Sun Apr 11 13:35:56 2021
+++ src/usr.bin/make/nonints.h	Sat Aug 14 13:32:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.213 2021/04/11 13:35:56 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.214 2021/08/14 13:32:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -164,7 +164,7 @@ void Parse_AddIncludeDir(const char *);
 void Parse_File(const char *, int);
 void Parse_SetInput(const char *, int, int, ReadMoreProc, void *);
 void Parse_MainName(GNodeList *);
-int Parse_GetFatals(void);
+int Parse_NumErrors(void);
 
 
 /* suff.c */

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.560 src/usr.bin/make/parse.c:1.561
--- src/usr.bin/make/parse.c:1.560	Mon Jun 21 10:42:06 2021
+++ src/usr.bin/make/parse.c	Sat Aug 14 13:32:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.560 2021/06/21 10:42:06 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.561 2021/08/14 13:32:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.560 2021/06/21 10:42:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.561 2021/08/14 13:32:12 rillig Exp $");
 
 /* types and constants */
 
@@ -218,7 +218,7 @@ static GNode *order_pred;
 /* parser state */
 
 /* number of fatal errors */
-static int fatals = 0;
+static int parseErrors = 0;
 
 /*
  * Variables for doing includes
@@ -613,7 +613,7 @@ ParseVErrorInternal(FILE *f, const char 
 		goto print_stack_trace;
 	if (type == PARSE_WARNING && !opts.parseWarnFatal)
 		goto print_stack_trace;
-	fatals++;
+	parseErrors++;
 	if (type == PARSE_WARNING && !fatal_warning_error_printed) {
 		Error("parsing warnings being treated as errors");
 		fatal_warning_error_printed = true;
@@ -3250,7 +3250,7 @@ Parse_File(const char *name, int fd)
 
 	FinishDependencyGroup();
 
-	if (fatals != 0) {
+	if (parseErrors != 0) {
 		(void)fflush(stdout);
 		(void)fprintf(stderr,
 		"%s: Fatal errors encountered -- cannot continue",
@@ -3305,7 +3305,7 @@ Parse_MainName(GNodeList *mainList)
 }
 
 int
-Parse_GetFatals(void)
+Parse_NumErrors(void)
 {
-	return fatals;
+	return parseErrors;
 }



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:26:07 UTC 2021

Modified Files:
src/usr.bin/make: arch.c

Log Message:
make: extract RanlibOODate into separate function

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/make/arch.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.200 src/usr.bin/make/arch.c:1.201
--- src/usr.bin/make/arch.c:1.200	Sun May 30 21:16:54 2021
+++ src/usr.bin/make/arch.c	Sat Aug 14 13:26:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.200 2021/05/30 21:16:54 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.201 2021/08/14 13:26:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.200 2021/05/30 21:16:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.201 2021/08/14 13:26:07 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -988,6 +988,34 @@ Arch_FindLib(GNode *gn, SearchPath *path
 #endif
 }
 
+static bool
+RanlibOODate(const GNode *gn MAKE_ATTR_UNUSED)
+{
+#ifdef RANLIBMAG
+	struct ar_hdr *arh;	/* Header for __.SYMDEF */
+	int tocModTime;		/* The table-of-contents' mod time */
+
+	arh = ArchStatMember(gn->path, RANLIBMAG, false);
+
+	if (arh == NULL) {
+		/* A library without a table of contents is out-of-date. */
+		if (DEBUG(ARCH) || DEBUG(MAKE))
+			debug_printf("no toc...");
+		return true;
+	}
+
+	tocModTime = (int)strtol(arh->ar_date, NULL, 10);
+
+	if (DEBUG(ARCH) || DEBUG(MAKE))
+		debug_printf("%s modified %s...",
+		RANLIBMAG, Targ_FmtTime(tocModTime));
+	return gn->youngestChild == NULL ||
+	   gn->youngestChild->mtime > tocModTime;
+#else
+	return false;
+#endif
+}
+
 /*
  * Decide if a node with the OP_LIB attribute is out-of-date. Called from
  * GNode_IsOODate to make its life easier.
@@ -1021,46 +1049,19 @@ Arch_FindLib(GNode *gn, SearchPath *path
 bool
 Arch_LibOODate(GNode *gn)
 {
-	bool oodate;
 
 	if (gn->type & OP_PHONY) {
-		oodate = true;
+		return true;
 	} else if (!GNode_IsTarget(gn) && Lst_IsEmpty(>children)) {
-		oodate = false;
+		return false;
 	} else if ((!Lst_IsEmpty(>children) && gn->youngestChild == NULL) ||
 		   (gn->mtime > now) ||
 		   (gn->youngestChild != NULL &&
 		gn->mtime < gn->youngestChild->mtime)) {
-		oodate = true;
+		return true;
 	} else {
-#ifdef RANLIBMAG
-		struct ar_hdr *arh;	/* Header for __.SYMDEF */
-		int modTimeTOC;		/* The table-of-contents' mod time */
-
-		arh = ArchStatMember(gn->path, RANLIBMAG, false);
-
-		if (arh != NULL) {
-			modTimeTOC = (int)strtol(arh->ar_date, NULL, 10);
-
-			if (DEBUG(ARCH) || DEBUG(MAKE))
-debug_printf("%s modified %s...",
-	 RANLIBMAG,
-	 Targ_FmtTime(modTimeTOC));
-			oodate = gn->youngestChild == NULL ||
- gn->youngestChild->mtime > modTimeTOC;
-		} else {
-			/*
-			 * A library without a table of contents is out-of-date.
-			 */
-			if (DEBUG(ARCH) || DEBUG(MAKE))
-debug_printf("no toc...");
-			oodate = true;
-		}
-#else
-		oodate = false;
-#endif
+		return RanlibOODate(gn);
 	}
-	return oodate;
 }
 
 /* Initialize the archives module. */



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:11:33 UTC 2021

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: remove workaround for initialization bug in lint

The bug has been fixed in init.c 1.208 from 2021-08-14.


To generate a diff of this commit:
cvs rdiff -u -r1.946 -r1.947 src/usr.bin/make/var.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/make/var.c
diff -u src/usr.bin/make/var.c:1.946 src/usr.bin/make/var.c:1.947
--- src/usr.bin/make/var.c:1.946	Sun Aug  8 12:00:30 2021
+++ src/usr.bin/make/var.c	Sat Aug 14 13:11:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.946 2021/08/08 12:00:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.947 2021/08/14 13:11:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.946 2021/08/08 12:00:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.947 2021/08/14 13:11:33 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4019,8 +4019,6 @@ ApplyModifiers(
 char endc		/* ')' or '}'; or '\0' for indirect modifiers */
 )
 {
-	/* LINTED 115 *//* warning: left operand of '=' must be modifiable lvalue */
-	/* That's a bug in lint; see tests/usr.bin/xlint/lint1/msg_115.c. */
 	ModChain ch = ModChain_Literal(expr, startc, endc, ' ', false);
 	const char *p;
 	const char *mod;



CVS commit: src/usr.bin/make

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:04:00 UTC 2021

Modified Files:
src/usr.bin/make: meta.c

Log Message:
make: fix lint warning about strchr removing 'const'

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/meta.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/make/meta.c
diff -u src/usr.bin/make/meta.c:1.181 src/usr.bin/make/meta.c:1.182
--- src/usr.bin/make/meta.c:1.181	Sun Apr  4 10:05:08 2021
+++ src/usr.bin/make/meta.c	Sat Aug 14 13:04:00 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.181 2021/04/04 10:05:08 rillig Exp $ */
+/*  $NetBSD: meta.c,v 1.182 2021/08/14 13:04:00 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -321,8 +321,7 @@ is_submake(const char *cmd, GNode *gn)
 static const char *p_make = NULL;
 static size_t p_len;
 char *mp = NULL;
-char *cp;
-char *cp2;
+const char *cp, *cp2;
 bool rc = false;
 
 if (p_make == NULL) {



CVS commit: src

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 13:00:55 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_init_array_using_string.c
d_init_array_using_string.exp d_long_double_int.exp msg_124.c
msg_124.exp msg_184.c msg_184.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: use standard quoting style for messages 124 and 184


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \
src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
cvs rdiff -u -r1.5 -r1.6 \
src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_124.c \
src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_184.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_184.exp
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.333 -r1.334 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.4 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.5
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.4	Fri Apr  9 23:03:26 2021
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c	Sat Aug 14 13:00:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_init_array_using_string.c,v 1.4 2021/04/09 23:03:26 rillig Exp $	*/
+/*	$NetBSD: d_init_array_using_string.c,v 1.5 2021/08/14 13:00:55 rillig Exp $	*/
 # 3 "d_init_array_using_string.c"
 
 /*
@@ -13,8 +13,10 @@ test_assignment_initialization(void)
 	const char *cs_match = "";
 	const int *ws_match = L"";
 
-	const char *cs_mismatch = L"";	/* expect: illegal pointer combination */
-	const int *ws_mismatch = "";	/* expect: illegal pointer combination */
+	/* expect+1: warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124] */
+	const char *cs_mismatch = L"";
+	/* expect+1: warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124] */
+	const int *ws_mismatch = "";
 }
 
 void
@@ -31,8 +33,10 @@ test_pointer_initialization_in_struct(vo
 	};
 
 	struct cs_ws type_mismatch = {
-		L"",		/* expect: illegal pointer combination */
-		"",		/* expect: illegal pointer combination */
+		/* expect+1: warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124] */
+		L"",
+		/* expect+1: warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124] */
+		"",
 	};
 
 	struct cs_ws extra_braces = {
Index: src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
diff -u src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.4 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.exp	Sat Aug 14 13:00:55 2021
@@ -1 +1 @@
-d_long_double_int.c(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op == [124]
+d_long_double_int.c(9): warning: illegal combination of 'pointer to long double' and 'pointer to long', op '==' [124]

Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.5 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.6
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.5	Sat Aug 14 12:46:24 2021
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp	Sat Aug 14 13:00:55 2021
@@ -1,8 +1,8 @@
-d_init_array_using_string.c(16): warning: illegal pointer combination (pointer to const char) and (pointer to int), op init [124]
-d_init_array_using_string.c(17): warning: illegal pointer combination (pointer to const int) and (pointer to char), op init [124]
-d_init_array_using_string.c(34): warning: illegal pointer combination (pointer to const char) and (pointer to int), op init [124]
-d_init_array_using_string.c(35): warning: illegal pointer combination (pointer to const int) and (pointer to char), op init [124]
-d_init_array_using_string.c(59): error: cannot initialize 'array[10] of const char' from 'pointer to int' [185]
-d_init_array_using_string.c(60): error: cannot initialize 'array[10] of const int' from 'pointer to char' [185]
-d_init_array_using_string.c(69): warning: non-null byte ignored in string initializer [187]
-d_init_array_using_string.c(70): warning: non-null byte ignored in string initializer [187]
+d_init_array_using_string.c(17): warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124]
+d_init_array_using_string.c(19): warning: illegal combination of 'pointer to const int' 

CVS commit: src

2021-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug 14 12:46:24 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.exp
d_c99_bool_strict_syshdr.exp d_init_array_using_string.exp
msg_115.c msg_115.exp msg_124.exp msg_164.c msg_164.exp msg_242.c
msg_242.exp
src/usr.bin/xlint/lint1: init.c ops.def tree.c

Log Message:
lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression.  The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different.  It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member.  Therefore it was wrong to use the
operator ASSIGN for initialization.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.10 -r1.11 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp
cvs rdiff -u -r1.4 -r1.5 \
src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_115.exp
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_164.c \
src/tests/usr.bin/xlint/lint1/msg_242.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_164.exp \
src/tests/usr.bin/xlint/lint1/msg_242.exp
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/ops.def
cvs rdiff -u -r1.332 -r1.333 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.27 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.28
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.27	Sun Jul  4 07:09:39 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp	Sat Aug 14 12:46:24 2021
@@ -144,10 +144,10 @@ d_c99_bool_strict.c(582): error: operand
 d_c99_bool_strict.c(583): error: operands of ':' have incompatible types (unsigned int != _Bool) [107]
 d_c99_bool_strict.c(589): warning: expression has null effect [129]
 d_c99_bool_strict.c(590): warning: expression has null effect [129]
-d_c99_bool_strict.c(603): error: operands of '=' have incompatible types (char != _Bool) [107]
-d_c99_bool_strict.c(604): error: operands of '=' have incompatible types (int != _Bool) [107]
-d_c99_bool_strict.c(605): error: operands of '=' have incompatible types (double != _Bool) [107]
-d_c99_bool_strict.c(606): error: operands of '=' have incompatible types (pointer != _Bool) [107]
+d_c99_bool_strict.c(603): error: operands of 'init' have incompatible types (char != _Bool) [107]
+d_c99_bool_strict.c(604): error: operands of 'init' have incompatible types (int != _Bool) [107]
+d_c99_bool_strict.c(605): error: operands of 'init' have incompatible types (double != _Bool) [107]
+d_c99_bool_strict.c(606): error: operands of 'init' have incompatible types (pointer != _Bool) [107]
 d_c99_bool_strict.c(623): error: operands of '=' have incompatible types (int != _Bool) [107]
 d_c99_bool_strict.c(624): error: operands of '=' have incompatible types (int != _Bool) [107]
 d_c99_bool_strict.c(625): error: operands of '=' have incompatible types (int != _Bool) [107]

Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp:1.10 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp:1.11
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp:1.10	Tue Aug  3 18:44:33 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp	Sat Aug 14 12:46:24 2021
@@ -1,6 +1,6 @@
 d_c99_bool_strict_syshdr.c(43): error: controlling expression must be bool, not 'int' [333]
 d_c99_bool_strict_syshdr.c(53): error: controlling expression must be bool, not 'int' [333]
-d_c99_bool_strict_syshdr.c(87): error: operands of '=' have incompatible types (_Bool != int) [107]
+d_c99_bool_strict_syshdr.c(87): error: operands of 'init' have incompatible types (_Bool != int) [107]
 d_c99_bool_strict_syshdr.c(162): error: return value type mismatch (_Bool) and (int) [211]
 d_c99_bool_strict_syshdr.c(175): error: operand of '!' must be bool, not 'int' [330]
 d_c99_bool_strict_syshdr.c(175): warning: function 'str_equal_bad' expects to return value [214]

Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.4 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.4	Fri 

CVS commit: src/sys/dev/marvell

2021-08-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Aug 13 21:04:44 UTC 2021

Modified Files:
src/sys/dev/marvell: if_mvxpe.c

Log Message:
s/fame/frame in mvxpe_mib_def with assumption that it was not intentional typo.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/marvell/if_mvxpe.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/dev/marvell/if_mvxpe.c
diff -u src/sys/dev/marvell/if_mvxpe.c:1.34 src/sys/dev/marvell/if_mvxpe.c:1.35
--- src/sys/dev/marvell/if_mvxpe.c:1.34	Mon Aug  2 12:56:24 2021
+++ src/sys/dev/marvell/if_mvxpe.c	Fri Aug 13 21:04:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvxpe.c,v 1.34 2021/08/02 12:56:24 andvar Exp $	*/
+/*	$NetBSD: if_mvxpe.c,v 1.35 2021/08/13 21:04:44 andvar Exp $	*/
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.34 2021/08/02 12:56:24 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.35 2021/08/13 21:04:44 andvar Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -218,7 +218,7 @@ STATIC struct mvxpe_mib_def {
 	"Frame Size  256 -  511"},
 	{MVXPE_MIB_RX_FRAME1023_OCT, 0,	"rx_frame_512_1023",
 	"Frame Size  512 - 1023", 0},
-	{MVXPE_MIB_RX_FRAMEMAX_OCT, 0,	"rx_fame_1024_max",
+	{MVXPE_MIB_RX_FRAMEMAX_OCT, 0,	"rx_frame_1024_max",
 	"Frame Size 1024 -  Max", 0},
 	{MVXPE_MIB_TX_GOOD_OCT, 1,	"tx_good_oct",
 	"Good Octets Tx", 0},



CVS commit: src

2021-08-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Aug 13 20:47:55 UTC 2021

Modified Files:
src/common/lib/libc/arch/sparc64/string: memset.S
src/sbin/ifconfig: ieee80211.c
src/sys/arch/mips/ralink: ralink_reg.h
src/sys/arch/powerpc/include: reg.h
src/sys/ddb: db_command.c
src/sys/dev/ic: aic79xx_inline.h dc21040reg.h
src/sys/dev/usb: xhci.c
src/sys/netinet: tcp_vtw.c

Log Message:
fix typos in words "pointer" and s/fram /frame/


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/sparc64/string/memset.S
cvs rdiff -u -r1.30 -r1.31 src/sbin/ifconfig/ieee80211.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/ralink/ralink_reg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/reg.h
cvs rdiff -u -r1.176 -r1.177 src/sys/ddb/db_command.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/aic79xx_inline.h
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/dc21040reg.h
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet/tcp_vtw.c

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

Modified files:

Index: src/common/lib/libc/arch/sparc64/string/memset.S
diff -u src/common/lib/libc/arch/sparc64/string/memset.S:1.2 src/common/lib/libc/arch/sparc64/string/memset.S:1.3
--- src/common/lib/libc/arch/sparc64/string/memset.S:1.2	Sun Mar 17 02:12:41 2013
+++ src/common/lib/libc/arch/sparc64/string/memset.S	Fri Aug 13 20:47:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: memset.S,v 1.2 2013/03/17 02:12:41 christos Exp $	*/
+/*	$NetBSD: memset.S,v 1.3 2021/08/13 20:47:54 andvar Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -25,7 +25,7 @@
  */
 #include "strmacros.h"
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: memset.S,v 1.2 2013/03/17 02:12:41 christos Exp $")
+RCSID("$NetBSD: memset.S,v 1.3 2021/08/13 20:47:54 andvar Exp $")
 #endif  /* LIBC_SCCS and not lint */
 
 
@@ -120,7 +120,7 @@ Lmemset_cleanup:	
 	 stb	%o1, [%o0]		!	*addr = 0;
 Lmemset_done:
 	retl
-	 mov	%o4, %o0		! Restore ponter for memset (ugh)
+	 mov	%o4, %o0		! Restore pointer for memset (ugh)
 
 #ifdef USE_BLOCK_STORE_LOAD
 Lmemset_block:

Index: src/sbin/ifconfig/ieee80211.c
diff -u src/sbin/ifconfig/ieee80211.c:1.30 src/sbin/ifconfig/ieee80211.c:1.31
--- src/sbin/ifconfig/ieee80211.c:1.30	Fri Aug 16 10:33:17 2019
+++ src/sbin/ifconfig/ieee80211.c	Fri Aug 13 20:47:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211.c,v 1.30 2019/08/16 10:33:17 msaitoh Exp $	*/
+/*	$NetBSD: ieee80211.c,v 1.31 2021/08/13 20:47:55 andvar Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ieee80211.c,v 1.30 2019/08/16 10:33:17 msaitoh Exp $");
+__RCSID("$NetBSD: ieee80211.c,v 1.31 2021/08/13 20:47:55 andvar Exp $");
 #endif /* not lint */
 
 #include 
@@ -531,7 +531,7 @@ ieee80211_statistics(prop_dictionary_t e
 	STAT_PRINT(is_rx_badsubtype, "rx frame w/ unknown subtyp");
 	STAT_PRINT(is_rx_nobuf, "rx failed for lack of buf");
 	STAT_PRINT(is_rx_decryptcrc, "rx decrypt failed on crc");
-	STAT_PRINT(is_rx_ahdemo_mgt, "rx discard ahdemo mgt fram");
+	STAT_PRINT(is_rx_ahdemo_mgt, "rx discard ahdemo mgt frame");
 	STAT_PRINT(is_rx_bad_auth, "rx bad auth request");
 	STAT_PRINT(is_rx_unauth, "rx on unauthorized port");
 	STAT_PRINT(is_rx_badkeyid, "rx w/ incorrect keyid");

Index: src/sys/arch/mips/ralink/ralink_reg.h
diff -u src/sys/arch/mips/ralink/ralink_reg.h:1.9 src/sys/arch/mips/ralink/ralink_reg.h:1.10
--- src/sys/arch/mips/ralink/ralink_reg.h:1.9	Wed Oct  5 15:54:58 2016
+++ src/sys/arch/mips/ralink/ralink_reg.h	Fri Aug 13 20:47:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_reg.h,v 1.9 2016/10/05 15:54:58 ryo Exp $	*/
+/*	$NetBSD: ralink_reg.h,v 1.10 2021/08/13 20:47:55 andvar Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -725,7 +725,7 @@ enum ralink_irq {
 #define RA_FE_TX_BASE_PTR_0	0x800	/*  TX Ring #0 Base Pointer */
 #define RA_FE_TX_MAX_CNT_0	0x804	/*  TX Ring #0 Maximum Count */
 #define RA_FE_TX_CTX_IDX_0	0x808	/*  TX Ring #0 CPU pointer */
-#define RA_FE_TX_DTX_IDX_0	0x80c	/*  TX Ring #0 DMA poitner */
+#define RA_FE_TX_DTX_IDX_0	0x80c	/*  TX Ring #0 DMA pointer */
 #define RA_FE_PDMA_TX0_PTR	RA_FE_TX_BASE_PTR_0
 #define RA_FE_PDMA_TX0_COUNT	RA_FE_TX_MAX_CNT_0
 #define RA_FE_PDMA_TX0_CPU_IDX	RA_FE_TX_CTX_IDX_0
@@ -733,19 +733,19 @@ enum ralink_irq {
 #define RA_FE_TX_BASE_PTR_1	0x810	/*  TX Ring #1 Base Pointer */
 #define RA_FE_TX_MAX_CNT_1	0x814	/*  TX Ring #1 Maximum Count */
 #define RA_FE_TX_CTX_IDX_1	0x818	/*  TX Ring #1 CPU pointer */
-#define RA_FE_TX_DTX_IDX_1	0x81c	/*  TX Ring #1 DMA poitner */
+#define RA_FE_TX_DTX_IDX_1	0x81c	/*  TX Ring #1 DMA pointer */
 #define RA_FE_TX_BASE_PTR_2	0x820	/*  TX Ring #2 Base Pointer */
 #define RA_FE_TX_MAX_CNT_2	0x824	/*  TX Ring #2 Maximum Count */
 #define RA_FE_TX_CTX_IDX_2	0x828	/*  TX Ring #2 CPU 

CVS commit: src/sys

2021-08-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Aug 13 20:26:07 UTC 2021

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S
src/sys/dev/marvell: mvxpsec.c
src/sys/dev/pci: if_bnx.c

Log Message:
s/struture/structure/ s/structre/structure/


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.185 -r1.186 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/marvell/mvxpsec.c
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/pci/if_bnx.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/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.210 src/sys/arch/amd64/amd64/locore.S:1.211
--- src/sys/arch/amd64/amd64/locore.S:1.210	Sun Jun 21 16:57:18 2020
+++ src/sys/arch/amd64/amd64/locore.S	Fri Aug 13 20:26:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.210 2020/06/21 16:57:18 bouyer Exp $	*/
+/*	$NetBSD: locore.S,v 1.211 2021/08/13 20:26:07 andvar Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1050,7 +1050,7 @@ ENTRY(start_xen32)
 	movl	$RELOC(HYPERVISOR_shared_info_pa),%ebp
 	movl	%ebx,(%ebp)
 	movl	$0,4(%ebp)
-	/* XXX assume hvm_start_info+dependant struture fits in a single page */
+	/* XXX assume hvm_start_info+dependant structure fits in a single page */
 	addl	$PAGE_SIZE, %ebx
 	addl	$PGOFSET,%ebx
 	andl	$~PGOFSET,%ebx

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.185 src/sys/arch/i386/i386/locore.S:1.186
--- src/sys/arch/i386/i386/locore.S:1.185	Wed May 27 19:33:40 2020
+++ src/sys/arch/i386/i386/locore.S	Fri Aug 13 20:26:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.185 2020/05/27 19:33:40 ad Exp $	*/
+/*	$NetBSD: locore.S,v 1.186 2021/08/13 20:26:07 andvar Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.185 2020/05/27 19:33:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.186 2021/08/13 20:26:07 andvar Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1205,7 +1205,7 @@ ENTRY(start_xenpvh)
 	andl	$~PGOFSET,%ebx
 	movl	$RELOC(HYPERVISOR_shared_info_pa),%ebp
 	movl	%ebx,(%ebp)
-	/* XXX assume hvm_start_info+dependant struture fits in a single page */
+	/* XXX assume hvm_start_info+dependant structure fits in a single page */
 	addl	$PAGE_SIZE, %ebx
 	addl	$PGOFSET,%ebx
 	andl	$~PGOFSET,%ebx

Index: src/sys/dev/marvell/mvxpsec.c
diff -u src/sys/dev/marvell/mvxpsec.c:1.7 src/sys/dev/marvell/mvxpsec.c:1.8
--- src/sys/dev/marvell/mvxpsec.c:1.7	Sat Jul 25 22:37:48 2020
+++ src/sys/dev/marvell/mvxpsec.c	Fri Aug 13 20:26:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvxpsec.c,v 1.7 2020/07/25 22:37:48 riastradh Exp $	*/
+/*	$NetBSD: mvxpsec.c,v 1.8 2021/08/13 20:26:07 andvar Exp $	*/
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -1487,7 +1487,7 @@ mvxpsec_packet_dtor(void *arg, void *obj
 }
 
 /*
- * allocate new session struture.
+ * allocate new session structure.
  */
 STATIC struct mvxpsec_session *
 mvxpsec_session_alloc(struct mvxpsec_softc *sc)

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.108 src/sys/dev/pci/if_bnx.c:1.109
--- src/sys/dev/pci/if_bnx.c:1.108	Sun Feb 14 14:05:03 2021
+++ src/sys/dev/pci/if_bnx.c	Fri Aug 13 20:26:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.108 2021/02/14 14:05:03 jakllsch Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.109 2021/08/13 20:26:07 andvar Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.108 2021/02/14 14:05:03 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.109 2021/08/13 20:26:07 andvar Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -2304,7 +2304,7 @@ bnx_init_media(struct bnx_softc *sc)
 //
 /* Free any DMA memory owned by the driver. */
 /*  */
-/* Scans through each data structre that requires DMA memory and frees  */
+/* Scans through each data structure that requires DMA memory and frees */
 /* the memory if allocated. */
 /*  */
 /* Returns: */



CVS commit: src/sys/arch/alpha/alpha

2021-08-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Aug 13 20:19:45 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: pmap.c

Log Message:
fix multiple typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/arch/alpha/alpha/pmap.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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.300 src/sys/arch/alpha/alpha/pmap.c:1.301
--- src/sys/arch/alpha/alpha/pmap.c:1.300	Sat Jul 31 14:51:25 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Fri Aug 13 20:19:45 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.300 2021/07/31 14:51:25 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.301 2021/08/13 20:19:45 andvar Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -106,8 +106,8 @@
  *
  *	All user page table access is done via K0SEG.  Kernel
  *	page table access is done via the recursive Virtual Page
- *	Table becase kernel PT pages are pre-allocated and never
- *	freed, so no VPT fault handling is requiried.
+ *	Table because kernel PT pages are pre-allocated and never
+ *	freed, so no VPT fault handling is required.
  */
 
 /*
@@ -135,7 +135,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2021/07/31 14:51:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.301 2021/08/13 20:19:45 andvar Exp $");
 
 #include 
 #include 
@@ -578,9 +578,9 @@ pmap_pvlist_free(struct pmap_pvlist * co
  * that includes room for 8 VAs, the pmap the VAs belong to, a bitmap of
  * CPUs to be notified, and a list for PT pages that are freed during
  * removal off mappings.  The number of valid addresses in the list as
- * well as flags are sqeezed into the lower bits of the first two VAs.
+ * well as flags are squeezed into the lower bits of the first two VAs.
  * Storage for this structure is allocated on the stack.  We need to be
- * careful to keep the size of this struture under control.
+ * careful to keep the size of this structure under control.
  *
  * When notifying remote CPUs, we acquire the tlb_lock (which also
  * blocks IPIs), record the pointer to our context structure, set a
@@ -589,9 +589,9 @@ pmap_pvlist_free(struct pmap_pvlist * co
  * any invalidations necessary on the local CPU.  Once that is done,
  * we then wait the the global context pointer to be cleared, which
  * will be done by the final remote CPU to complete their work. This
- * method reduces cache line contention during pocessing.
+ * method reduces cache line contention during processing.
  *
- * When removing mappings in user pmaps, this implemention frees page
+ * When removing mappings in user pmaps, this implementation frees page
  * table pages back to the VM system once they contain no valid mappings.
  * As we do this, we must ensure to invalidate TLB entries that the
  * CPU might hold for the respective recursive VPT mappings.  This must
@@ -1038,7 +1038,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 
 	/*
 	 * Figure out who to notify.  If it's for the kernel or
-	 * multiple aaddress spaces, we notify everybody.  If
+	 * multiple address spaces, we notify everybody.  If
 	 * it's a single user pmap, then we try to acquire the
 	 * activation lock so we can get an accurate accounting
 	 * of who needs to be notified.  If we can't acquire
@@ -2094,7 +2094,7 @@ pmap_enter_tlb_shootdown(pmap_t const pm
  * pmap_enter_l2pt_delref:
  *
  *	Release a reference on an L2 PT page for pmap_enter().
- *	This is factored out separately becacause we expect it
+ *	This is factored out separately because we expect it
  *	to be a rare case.
  */
 static void __noinline
@@ -2105,7 +2105,7 @@ pmap_enter_l2pt_delref(pmap_t const pmap
 
 	/*
 	 * PALcode may have tried to service a TLB miss with
-	 * this L2 PTE, so we need to make sure we don't actully
+	 * this L2 PTE, so we need to make sure we don't actually
 	 * free the PT page untl we've shot down any TLB entries
 	 * for this VPT index.
 	 */
@@ -2122,7 +2122,7 @@ pmap_enter_l2pt_delref(pmap_t const pmap
  * pmap_enter_l3pt_delref:
  *
  *	Release a reference on an L3 PT page for pmap_enter().
- *	This is factored out separately becacause we expect it
+ *	This is factored out separately because we expect it
  *	to be a rare case.
  */
 static void __noinline
@@ -2133,8 +2133,8 @@ pmap_enter_l3pt_delref(pmap_t const pmap
 
 	/*
 	 * PALcode may have tried to service a TLB miss with
-	 * this PTE, so we need to make sure we don't actully
-	 * free the PT page untl we've shot down any TLB entries
+	 * this PTE, so we need to make sure we don't actually
+	 * free the PT page until we've shot down any TLB entries
 	 * for this VPT index.
 	 */
 
@@ -2256,7 +2256,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd
 	 * new one immediately.
 	 */
 	if ((opte & PG_V) == 0) {
-		/* No TLB invalidatons needed for new mappings. */
+		/* No TLB 

CVS commit: src

2021-08-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Aug 13 20:19:14 UTC 2021

Modified Files:
src/tests/sys/uvm: t_uvm_physseg.c
src/usr.sbin/syslogd: syslogd.c

Log Message:
s/bacause/because/


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/sys/uvm/t_uvm_physseg.c
cvs rdiff -u -r1.136 -r1.137 src/usr.sbin/syslogd/syslogd.c

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

Modified files:

Index: src/tests/sys/uvm/t_uvm_physseg.c
diff -u src/tests/sys/uvm/t_uvm_physseg.c:1.8 src/tests/sys/uvm/t_uvm_physseg.c:1.9
--- src/tests/sys/uvm/t_uvm_physseg.c:1.8	Wed Jan 16 13:54:17 2019
+++ src/tests/sys/uvm/t_uvm_physseg.c	Fri Aug 13 20:19:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: t_uvm_physseg.c,v 1.8 2019/01/16 13:54:17 fox Exp $ */
+/* $NetBSD: t_uvm_physseg.c,v 1.9 2021/08/13 20:19:13 andvar Exp $ */
 
 /*-
  * Copyright (c) 2015, 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_uvm_physseg.c,v 1.8 2019/01/16 13:54:17 fox Exp $");
+__RCSID("$NetBSD: t_uvm_physseg.c,v 1.9 2021/08/13 20:19:13 andvar Exp $");
 
 /*
  * If this line is commented out tests related to uvm_physseg_get_pmseg()
@@ -2251,7 +2251,7 @@ ATF_TC_BODY(uvm_page_physunload_force, t
 	/* Insert more than one segment iff VM_PHYSSEG_MAX > 1 */
 #if VM_PHYSSEG_MAX > 1
 	/*
-	 * We have couple of physloads done this is bacause of the fact that if
+	 * We have couple of physloads done this is because of the fact that if
 	 * we physunload all the PFs from a given range and we have only one
 	 * segment in total a panic() is called
 	 */

Index: src/usr.sbin/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.136 src/usr.sbin/syslogd/syslogd.c:1.137
--- src/usr.sbin/syslogd/syslogd.c:1.136	Sun Nov  8 01:12:46 2020
+++ src/usr.sbin/syslogd/syslogd.c	Fri Aug 13 20:19:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.136 2020/11/08 01:12:46 dholland Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.137 2021/08/13 20:19:14 andvar Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)syslogd.c	8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.136 2020/11/08 01:12:46 dholland Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.137 2021/08/13 20:19:14 andvar Exp $");
 #endif
 #endif /* not lint */
 
@@ -580,7 +580,7 @@ getgroup:
 	/*
 	 * Create the global kernel event descriptor.
 	 *
-	 * NOTE: We MUST do this after daemon(), bacause the kqueue()
+	 * NOTE: We MUST do this after daemon(), because the kqueue()
 	 * API dictates that kqueue descriptors are not inherited
 	 * across forks (lame!).
 	 */



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

2021-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 13 11:40:43 UTC 2021

Modified Files:
src/sys/arch/arm/footbridge: footbridge.c footbridge_clock.c
footbridge_com.c footbridge_com_io.c footbridge_intr.h
footbridge_io.c footbridge_irqhandler.c footbridge_pci.c
src/sys/arch/arm/footbridge/isa: dsrtc.c isa_io.c isa_io_asm.S
isa_machdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/footbridge/footbridge.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/footbridge/footbridge_clock.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/footbridge/footbridge_com.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/footbridge/footbridge_com_io.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/footbridge/footbridge_intr.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/footbridge/footbridge_io.c
cvs rdiff -u -r1.27 -r1.28 \
src/sys/arch/arm/footbridge/footbridge_irqhandler.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/footbridge/footbridge_pci.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/footbridge/isa/dsrtc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/footbridge/isa/isa_io.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/footbridge/isa/isa_io_asm.S
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/footbridge/isa/isa_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/arm/footbridge/footbridge.c
diff -u src/sys/arch/arm/footbridge/footbridge.c:1.28 src/sys/arch/arm/footbridge/footbridge.c:1.29
--- src/sys/arch/arm/footbridge/footbridge.c:1.28	Sat Aug  7 16:18:43 2021
+++ src/sys/arch/arm/footbridge/footbridge.c	Fri Aug 13 11:40:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge.c,v 1.28 2021/08/07 16:18:43 thorpej Exp $	*/
+/*	$NetBSD: footbridge.c,v 1.29 2021/08/13 11:40:43 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.28 2021/08/07 16:18:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.29 2021/08/13 11:40:43 skrll Exp $");
 
 #include 
 #include 
@@ -58,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: footbridge.c
 #include 
 #include 
 #include 
- 
+
 /*
  * DC21285 'Footbridge' device
  *
@@ -126,8 +126,8 @@ footbridge_print(void *aux, const char *
  * int footbridge_match(device_t parent, cfdata_t cf, void *aux)
  *
  * Just return ok for this if it is device 0
- */ 
- 
+ */
+
 static int
 footbridge_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -141,7 +141,7 @@ footbridge_match(device_t parent, cfdata
  * void footbridge_attach(device_t parent, device_t dev, void *aux)
  *
  */
-  
+
 static void
 footbridge_attach(device_t parent, device_t self, void *aux)
 {
@@ -188,7 +188,7 @@ footbridge_attach(device_t parent, devic
 	"targ abt", footbridge_intr, sc);
 	sc->sc_parity_ih = footbridge_intr_claim(IRQ_PARITY, IPL_HIGH,
 	"parity", footbridge_intr, sc);
-	
+
 	/* Set up the PCI bus tags */
 	footbridge_create_io_bs_tag(_pci_io_bs_tag,
 	(void *)DC21285_PCI_IO_VBASE);
@@ -220,7 +220,7 @@ footbridge_attach(device_t parent, devic
 break;
 		mask--;
 		mask &= SDRAM_MASK_256MB;
-		
+
 		/*
 		 * configure the mask, the offset into SDRAM and the address
 		 * SDRAM is exposed on the PCI bus.
@@ -255,7 +255,7 @@ footbridge_attach(device_t parent, devic
 	fba.fba_fca.fca_tx_irq = IRQ_SERIAL_TX;
 	config_found(self, _fca, footbridge_print,
 	CFARGS(.iattr = "footbridge"));
-	
+
 	/* Setup fast SA110 cache clean area */
 #ifdef CPU_SA110
 	if (cputype == CPU_ID_SA110)

Index: src/sys/arch/arm/footbridge/footbridge_clock.c
diff -u src/sys/arch/arm/footbridge/footbridge_clock.c:1.26 src/sys/arch/arm/footbridge/footbridge_clock.c:1.27
--- src/sys/arch/arm/footbridge/footbridge_clock.c:1.26	Tue Jul 21 07:35:55 2009
+++ src/sys/arch/arm/footbridge/footbridge_clock.c	Fri Aug 13 11:40:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge_clock.c,v 1.26 2009/07/21 07:35:55 skrll Exp $	*/
+/*	$NetBSD: footbridge_clock.c,v 1.27 2021/08/13 11:40:43 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: footbridge_clock.c,v 1.26 2009/07/21 07:35:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge_clock.c,v 1.27 2021/08/13 11:40:43 skrll Exp $");
 
 /* Include header files */
 
@@ -88,8 +88,8 @@ CFATTACH_DECL_NEW(footbridge_clock, size
  * int clockmatch(device_t parent, cfdata_t cf, void *aux);
  *
  * Just return ok for this if it is device 0
- */ 
- 
+ */
+
 static int
 clockmatch(device_t parent, cfdata_t cf, void *aux)
 {
@@ -105,7 +105,7 @@ clockmatch(device_t parent, cfdata_t cf,
  * void clockattach(device_t parent, device_t self, void *aux)
  *
  */
-  
+
 static void
 clockattach(device_t parent, device_t self, void *aux)
 {
@@ -119,7 +119,7 @@ clockattach(device_t parent, device_t se
 	clock_sc = sc;
 
 	/* 

CVS commit: src

2021-08-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 12 20:53:18 UTC 2021

Modified Files:
src/lib/libc/stdlib: setenv.c
src/lib/libm/arch/x86_64: fenv.c
src/sys/arch/powerpc/include: reg.h
src/sys/arch/sgimips/sgimips: machdep.c

Log Message:
fix typos in "environment" word.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/stdlib/setenv.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/arch/x86_64/fenv.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/reg.h
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/sgimips/sgimips/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/lib/libc/stdlib/setenv.c
diff -u src/lib/libc/stdlib/setenv.c:1.44 src/lib/libc/stdlib/setenv.c:1.45
--- src/lib/libc/stdlib/setenv.c:1.44	Tue Jan 20 18:31:25 2015
+++ src/lib/libc/stdlib/setenv.c	Thu Aug 12 20:53:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: setenv.c,v 1.44 2015/01/20 18:31:25 christos Exp $	*/
+/*	$NetBSD: setenv.c,v 1.45 2021/08/12 20:53:18 andvar Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setenv.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: setenv.c,v 1.44 2015/01/20 18:31:25 christos Exp $");
+__RCSID("$NetBSD: setenv.c,v 1.45 2021/08/12 20:53:18 andvar Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,7 +76,7 @@ setenv(const char *name, const char *val
 	if (!__writelockenv())
 		return -1;
 
-	/* Find slot in the enviroment. */
+	/* Find slot in the environment. */
 	offset = __getenvslot(name, l_name, true);
 	if (offset == -1)
 		goto bad;

Index: src/lib/libm/arch/x86_64/fenv.c
diff -u src/lib/libm/arch/x86_64/fenv.c:1.7 src/lib/libm/arch/x86_64/fenv.c:1.8
--- src/lib/libm/arch/x86_64/fenv.c:1.7	Wed Mar 22 23:11:09 2017
+++ src/lib/libm/arch/x86_64/fenv.c	Thu Aug 12 20:53:18 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fenv.c,v 1.7 2017/03/22 23:11:09 chs Exp $ */
+/* $NetBSD: fenv.c,v 1.8 2021/08/12 20:53:18 andvar Exp $ */
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.7 2017/03/22 23:11:09 chs Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.8 2021/08/12 20:53:18 andvar Exp $");
 
 #include "namespace.h"
 
@@ -150,7 +150,7 @@ feclearexcept(int excepts)
 	/* Clear the requested floating-point exceptions */
 	fenv.x87.status &= ~ex;
 
-	/* Load the x87 floating-point environent */
+	/* Load the x87 floating-point environment */
 	__fldenv(fenv);
 
 	/* Same for SSE environment */
@@ -239,7 +239,7 @@ fesetexceptflag(const fexcept_t *flagp, 
 	/* Set the requested status flags */
 	fenv.x87.status |= *flagp & ex;
 
-	/* Load the x87 floating-point environent */
+	/* Load the x87 floating-point environment */
 	__fldenv(fenv);
 
 	/* Same for SSE environment */

Index: src/sys/arch/powerpc/include/reg.h
diff -u src/sys/arch/powerpc/include/reg.h:1.12 src/sys/arch/powerpc/include/reg.h:1.13
--- src/sys/arch/powerpc/include/reg.h:1.12	Sun Jan 24 20:02:38 2016
+++ src/sys/arch/powerpc/include/reg.h	Thu Aug 12 20:53:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.12 2016/01/24 20:02:38 christos Exp $	*/
+/*	$NetBSD: reg.h,v 1.13 2021/08/12 20:53:18 andvar Exp $	*/
 
 #ifndef _POWERPC_REG_H_
 #define _POWERPC_REG_H_
@@ -21,7 +21,7 @@
  *
  *  [Start of callee-saved registers]
  *  r14-r30	Registers used for local variables
- *  r31		Used for local variable or "environent pointers"
+ *  r31		Used for local variable or "environment pointers"
  *  f14-f31	Registers used for local variables
  *
  *

Index: src/sys/arch/sgimips/sgimips/machdep.c
diff -u src/sys/arch/sgimips/sgimips/machdep.c:1.151 src/sys/arch/sgimips/sgimips/machdep.c:1.152
--- src/sys/arch/sgimips/sgimips/machdep.c:1.151	Sat Jul 24 21:31:35 2021
+++ src/sys/arch/sgimips/sgimips/machdep.c	Thu Aug 12 20:53:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.151 2021/07/24 21:31:35 andvar Exp $	*/
+/*	$NetBSD: machdep.c,v 1.152 2021/08/12 20:53:18 andvar Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.151 2021/07/24 21:31:35 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.152 2021/08/12 20:53:18 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -402,8 +402,8 @@ mach_init(int argc, int32_t argv32[], ui
 	}
 
 	/*
-	 * Also try to get the default bootpath from ARCBIOS envronment
-	 * bacause bootpath is not set properly by old bootloaders and
+	 * Also try to get the default bootpath from ARCBIOS environment
+	 * because bootpath is not set properly by old bootloaders and
 	 * argv[0] might be invalid on some machine.
 	 */
 	osload = arcbios_GetEnvironmentVariable("OSLoadPartition");



CVS commit: src

2021-08-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 12 20:25:27 UTC 2021

Modified Files:
src/share/man/man3: dirent.3
src/sys/nfs: nfsm_subs.h

Log Message:
s/directry/directory/


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man3/dirent.3
cvs rdiff -u -r1.54 -r1.55 src/sys/nfs/nfsm_subs.h

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/dirent.3
diff -u src/share/man/man3/dirent.3:1.6 src/share/man/man3/dirent.3:1.7
--- src/share/man/man3/dirent.3:1.6	Sat Sep  7 12:17:10 2019
+++ src/share/man/man3/dirent.3	Thu Aug 12 20:25:26 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: dirent.3,v 1.6 2019/09/07 12:17:10 sevan Exp $
+.\" $NetBSD: dirent.3,v 1.7 2021/08/12 20:25:26 andvar Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -206,7 +206,7 @@ operator.
 .\" .St -p1003.1-2001 .
 .Sh HISTORY
 A
-directry file format appeared in
+directory file format appeared in
 .At v1 .
 The
 .Em dirent

Index: src/sys/nfs/nfsm_subs.h
diff -u src/sys/nfs/nfsm_subs.h:1.54 src/sys/nfs/nfsm_subs.h:1.55
--- src/sys/nfs/nfsm_subs.h:1.54	Sat Apr  4 07:07:20 2020
+++ src/sys/nfs/nfsm_subs.h	Thu Aug 12 20:25:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsm_subs.h,v 1.54 2020/04/04 07:07:20 mlelstv Exp $	*/
+/*	$NetBSD: nfsm_subs.h,v 1.55 2021/08/12 20:25:27 andvar Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -152,7 +152,7 @@
  * for nfsv3, dissect post_op_fh3 and following post_op_attr.
  * for nfsv2, dissect fhandle and following fattr.
  *
- * d: (IN) the vnode of the parent directry.
+ * d: (IN) the vnode of the parent directory.
  * v: (OUT) the corresponding vnode (we allocate one if needed)
  * v3: (IN) true for nfsv3.
  * f: (OUT) true if we got valid filehandle.  always true for nfsv2.



CVS commit: src/sys/arch/amiga/amiga

2021-08-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 12 20:13:54 UTC 2021

Modified Files:
src/sys/arch/amiga/amiga: cc.c cc.h

Log Message:
s/iterrupt sever/interrupt server/


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amiga/amiga/cc.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amiga/amiga/cc.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/amiga/amiga/cc.c
diff -u src/sys/arch/amiga/amiga/cc.c:1.27 src/sys/arch/amiga/amiga/cc.c:1.28
--- src/sys/arch/amiga/amiga/cc.c:1.27	Sun Aug 20 11:03:04 2017
+++ src/sys/arch/amiga/amiga/cc.c	Thu Aug 12 20:13:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.c,v 1.27 2017/08/20 11:03:04 maxv Exp $	*/
+/*	$NetBSD: cc.c,v 1.28 2021/08/12 20:13:54 andvar Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.27 2017/08/20 11:03:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.28 2021/08/12 20:13:54 andvar Exp $");
 
 #include 
 #include 
@@ -61,7 +61,7 @@ custom_chips_init(void)
 }
 
 /*
- * Vertical blank iterrupt sever chains.
+ * Vertical blank interrupt server chains.
  */
 LIST_HEAD(vbllist, vbl_node) vbl_list;
 

Index: src/sys/arch/amiga/amiga/cc.h
diff -u src/sys/arch/amiga/amiga/cc.h:1.18 src/sys/arch/amiga/amiga/cc.h:1.19
--- src/sys/arch/amiga/amiga/cc.h:1.18	Fri Jan  3 07:14:20 2014
+++ src/sys/arch/amiga/amiga/cc.h	Thu Aug 12 20:13:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.h,v 1.18 2014/01/03 07:14:20 mlelstv Exp $	*/
+/*	$NetBSD: cc.h,v 1.19 2021/08/12 20:13:54 andvar Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -71,7 +71,7 @@ struct audio_channel {
 #define AUCC_ALLDMAF (DMAF_AUD0|DMAF_AUD1|DMAF_AUD2|DMAF_AUD3)
 
 /*
- * Vertical blank iterrupt sever chains.
+ * Vertical blank interrupt server chains.
  */
 
 struct vbl_node {



CVS commit: src/sys

2021-08-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 12 19:53:18 UTC 2021

Modified Files:
src/sys/arch/atari/dev: grfabs_et.c
src/sys/dev/qbus: rf.c

Log Message:
fix various typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/atari/dev/grfabs_et.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/qbus/rf.c

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

Modified files:

Index: src/sys/arch/atari/dev/grfabs_et.c
diff -u src/sys/arch/atari/dev/grfabs_et.c:1.35 src/sys/arch/atari/dev/grfabs_et.c:1.36
--- src/sys/arch/atari/dev/grfabs_et.c:1.35	Mon Sep  3 16:29:24 2018
+++ src/sys/arch/atari/dev/grfabs_et.c	Thu Aug 12 19:53:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: grfabs_et.c,v 1.35 2018/09/03 16:29:24 riastradh Exp $	*/
+/*	$NetBSD: grfabs_et.c,v 1.36 2021/08/12 19:53:18 andvar Exp $	*/
 
 /*
  * Copyright (c) 1996 Leo Weppelman.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grfabs_et.c,v 1.35 2018/09/03 16:29:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grfabs_et.c,v 1.36 2021/08/12 19:53:18 andvar Exp $");
 
 #include 
 #include 
@@ -165,7 +165,7 @@ struct grfabs_et_priv {
 
 /*
  * XXX: called from ite console init routine.
- * Initialize list of posible video modes.
+ * Initialize list of possible video modes.
  */
 void
 et_probe_video(MODES *modelp)

Index: src/sys/dev/qbus/rf.c
diff -u src/sys/dev/qbus/rf.c:1.36 src/sys/dev/qbus/rf.c:1.37
--- src/sys/dev/qbus/rf.c:1.36	Sat Aug  7 16:19:15 2021
+++ src/sys/dev/qbus/rf.c	Thu Aug 12 19:53:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf.c,v 1.36 2021/08/07 16:19:15 thorpej Exp $	*/
+/*	$NetBSD: rf.c,v 1.37 2021/08/12 19:53:18 andvar Exp $	*/
 /*
  * Copyright (c) 2002 Jochen Kunz.
  * All rights reserved.
@@ -36,7 +36,7 @@ TODO:
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.36 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.37 2021/08/12 19:53:18 andvar Exp $");
 
 /* autoconfig stuff */
 #include 
@@ -70,7 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.36 
 /* hz for above */
 #include 
 
-/* bitdefinitions for RX211 */
+/* bit definitions for RX211 */
 #include 
 
 
@@ -392,8 +392,8 @@ rfc_attach(device_t parent, device_t sel
 
 #ifndef RX02_PROBE
 	/*
-	 * Bouth disk drievs and the controller are one physical unit.
-	 * If we found the controller, there will be bouth disk drievs.
+	 * Both disk drives and the controller are one physical unit.
+	 * If we found the controller, there will be both disk drives.
 	 * So attach them.
 	 */
 	rfc_aa.dnum = 0;
@@ -406,7 +406,7 @@ rfc_attach(device_t parent, device_t sel
 	/*
 	 * There are clones of the DEC RX system with standard shugart
 	 * interface. In this case we can not be sure that there are
-	 * bouth disk drievs. So we want to do a detection of attached
+	 * both disk drives. So we want to do a detection of attached
 	 * drives. This is done by reading a sector from disk. This means
 	 * that there must be a formatted disk in the drive at boot time.
 	 * This is bad, but I did not find another way to detect the
@@ -472,7 +472,7 @@ rf_attach(device_t parent, device_t self
 	dl->d_typename[4] = '\0';
 	dl->d_secsize = DEV_BSIZE;		/* bytes per sector */
 	/*
-	 * Fill in some values to have a initialized data structure. Some
+	 * Fill in some values to have an initialized data structure. Some
 	 * values will be reset by rfopen() depending on the actual density.
 	 */
 	dl->d_nsectors = RX2_SECTORS;		/* sectors per track */
@@ -617,7 +617,7 @@ rfstrategy(struct buf *buf)
  * and start to process it if there is one.
  * If the bufferqueue is empty, look at the bufferqueue of the other drive
  * that is attached to this controller.
- * Start procesing the bufferqueue of the other drive if it isn't empty.
+ * Start processing the bufferqueue of the other drive if it isn't empty.
  * Return a pointer to the softc structure of the drive that is now
  * ready to process a buffer or NULL if there is no buffer in either queues.
  */
@@ -1011,9 +1011,9 @@ rfopen(dev_t dev, int oflags, int devtyp
 		 * Controller is idle and density is not detected.
 		 * Start a density probe by issuing a read sector command
 		 * and sleep until the density probe finished.
-		 * Due to this it is imposible to open unformatted media.
+		 * Due to this it is impossible to open unformatted media.
 		 * As the RX02/02 is not able to format its own media,
-		 * media must be purchased preformatted. fsck DEC makreting!
+		 * media must be purchased preformatted. fsck DEC marketing!
 		 */
 		RFS_SETCMD(rf_sc->sc_state, RFS_PROBING);
 		disk_busy(_sc->sc_disk);



CVS commit: src/sys/kern

2021-08-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 12 19:15:15 UTC 2021

Modified Files:
src/sys/kern: vnode_if.sh

Log Message:
s/beween/between/


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/vnode_if.sh

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/vnode_if.sh
diff -u src/sys/kern/vnode_if.sh:1.70 src/sys/kern/vnode_if.sh:1.71
--- src/sys/kern/vnode_if.sh:1.70	Sat May 16 18:31:50 2020
+++ src/sys/kern/vnode_if.sh	Thu Aug 12 19:15:15 2021
@@ -29,7 +29,7 @@ copyright="\
  * SUCH DAMAGE.
  */
 "
-SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.70 2020/05/16 18:31:50 christos Exp $'
+SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.71 2021/08/12 19:15:15 andvar Exp $'
 
 # Script to produce VFS front-end sugar.
 #
@@ -86,7 +86,7 @@ fi
 # Input to this parser is pre-processed slightly by sed
 # so this awk parser doesn't have to work so hard.  The
 # changes done by the sed pre-processing step are:
-#	insert a space beween * and pointer name
+#	insert a space between * and pointer name
 #	replace semicolons with spaces
 #
 sed_prep='s:\*\([^\*/]\):\* \1:g



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

2021-08-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 12 15:06:39 UTC 2021

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

Log Message:
add directory for debug data for mkdep tests


To generate a diff of this commit:
cvs rdiff -u -r1.1110 -r1. src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1110 src/distrib/sets/lists/tests/mi:1.
--- src/distrib/sets/lists/tests/mi:1.1110	Wed Aug 11 20:42:26 2021
+++ src/distrib/sets/lists/tests/mi	Thu Aug 12 15:06:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1110 2021/08/11 20:42:26 rillig Exp $
+# $NetBSD: mi,v 1. 2021/08/12 15:06:39 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -197,6 +197,7 @@
 ./usr/libdata/debug/usr/tests/usr.bin			tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/cpio		tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/id		tests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/mkdep		tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify	tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/tar		tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.sbin			tests-usr.sbin-debug	compattestfile,atf



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

2021-08-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 12 13:27:42 UTC 2021

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

Log Message:
h_findcc.debug is not obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/distrib/sets/lists/debug/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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.358 src/distrib/sets/lists/debug/mi:1.359
--- src/distrib/sets/lists/debug/mi:1.358	Thu Aug 12 12:51:25 2021
+++ src/distrib/sets/lists/debug/mi	Thu Aug 12 13:27:42 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.358 2021/08/12 12:51:25 martin Exp $
+# $NetBSD: mi,v 1.359 2021/08/12 13:27:42 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2487,10 +2487,10 @@
 ./usr/libdata/debug/usr/tests/syscall/t_unlink.debug			tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/usr.bin/cpio/h_cpio.debug			tests-usr.bin-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/usr.bin/id/h_id.debug			tests-usr.bin-debug	debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug		tests-usr.bin-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug			tests-usr.bin-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/util/df/h_df.debug			tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/util/id/h_id.debug			tests-obsolete		obsolete,compattestfile
-./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug		tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug	tests-obsolete		obsolete,compattestfile
 ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a	comp-c-debuglib		atf,debuglib,compattestfile
 ./var/db/obsolete/debugbase-sys-root		debug



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

2021-08-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 12 12:51:25 UTC 2021

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

Log Message:
oops, fix h_findcc entry


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/distrib/sets/lists/debug/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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.357 src/distrib/sets/lists/debug/mi:1.358
--- src/distrib/sets/lists/debug/mi:1.357	Thu Aug 12 11:57:07 2021
+++ src/distrib/sets/lists/debug/mi	Thu Aug 12 12:51:25 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.357 2021/08/12 11:57:07 martin Exp $
+# $NetBSD: mi,v 1.358 2021/08/12 12:51:25 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2490,7 +2490,7 @@
 ./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug			tests-usr.bin-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/util/df/h_df.debug			tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/util/id/h_id.debug			tests-obsolete		obsolete,compattestfile
-./usr/tests/usr.bin/mkdep/h_findcc.debugtests-obsolete		obsolete,compattestfile
+./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug		tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug	tests-obsolete		obsolete,compattestfile
 ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a	comp-c-debuglib		atf,debuglib,compattestfile
 ./var/db/obsolete/debugbase-sys-root		debug



  1   2   3   4   5   6   7   8   9   10   >