Re: CVS commit: src/etc/rc.d

2021-11-30 Thread Stephen Borrill

On 26/11/2021 17:52, Robert Elz wrote:

 Date:Fri, 26 Nov 2021 13:11:36 +
 From:"Stephen Borrill" 
 Message-ID:  <20211126131136.63fabf...@cvs.netbsd.org>

   | Load rc configuration based on rcvar, not name, so that correct settings
   | in /etc/rc.conf.d are loaded.

This looks wrong to me (and a pullup request so soon after making a
change, before it has had any time for testing in HEAD is a *really*
bad idea).

   | Usually this does not matter as rcvar and name are set to the same value.
   | For pf_boot and npf_boot, rcvar is set to pf and npf respectively.
   |
   | Prior to the change, if:
   | rc.conf contains npf=YES
   | rc.conf.d/npf does not exist

Nor should it, that's not the file that is supposed to be used.

In rc.conf(5):


 rc.d(8) scripts that use load_rc_config from rc.subr(8) also support
 sourcing an optional end-user provided per-script override file
 /etc/rc.conf.d/service, (where service is the contents of the name
 variable in the rc.d(8) script).

That is, what should happen to make this work...

   | If:
   | rc.conf contains npf=NO (or is not set)
   | rc.conf.d/npf contains npf=YES

is that rc.conf.d/npf_boot should contain npf=YES

The rc.conf.d files have the same names as the rc.d/script files in
general, for good reason, as while they often only contain this
rcvar setting, they can contain overrides to anything in the script.
Further, if there is more than one rcvar in a script (which I think
has happened once or twice) the settings for both of them would go
in the same file, not one file for each of them.

   | This means that in the latter case, at boot time the npfctl start command
   | is never run and the firewall is not operational.

Because of user error.

Please revert this change, and request the pullup be undone as well.
I don't think it is as simple as this in the case of npf and pf. What 
has happened here is that the functionality of /etc/rc.d/npf has 
effectively been split into two parts (one to run early, the other 
late). It does not make sense to run one without the other. It's not 
like nfs which is a stack of mountd, rpcbind, nfsd, etc. which may well 
want different flags for each.


In rc.conf, npf=YES is sufficient, but you are advocating the setting 
needs to be duplicated if put into rc.conf.d. When upgrading from 8 to 
9, this is a breaking change.


I propose an alternative fix which is to change /etc/rc.d/npf_boot to read:

load_rc_config $name
load_rc_config_var npf npf

--
Stephen


Re: CVS commit: src/etc/rc.d

2021-11-30 Thread Martin Husemann
On Tue, Nov 30, 2021 at 09:10:35AM +, Stephen Borrill wrote:
> In rc.conf, npf=YES is sufficient, but you are advocating the setting needs
> to be duplicated if put into rc.conf.d.

I think the confusion starts with the idea of enabling NPF by just
putting the NPF=yes into scripts in /etc/rc.conf.d.

It might have worked by pure luck in older releases, but it was wrong there
too.

I would argue that to enable it you should have NPF=yes in /etc/rc.conf,
and to override special stuff in the $name script  (which I can't think
of reasonable uses for this case) you would put that overrides into
/etc/rc.conf.d/$name.


Martin


Re: CVS commit: src/etc/rc.d

2021-11-30 Thread Stephen Borrill

On 30/11/2021 09:43, Martin Husemann wrote:

On Tue, Nov 30, 2021 at 09:10:35AM +, Stephen Borrill wrote:

In rc.conf, npf=YES is sufficient, but you are advocating the setting needs
to be duplicated if put into rc.conf.d.


I think the confusion starts with the idea of enabling NPF by just
putting the NPF=yes into scripts in /etc/rc.conf.d.

It might have worked by pure luck in older releases, but it was wrong there
too.

I would argue that to enable it you should have NPF=yes in /etc/rc.conf,
and to override special stuff in the $name script  (which I can't think
of reasonable uses for this case) you would put that overrides into
/etc/rc.conf.d/$name.


In our products, we have a standard rc.conf and then a series of build 
scripts that configure and enable/disable services as required. We can 
switch between npf and ipfilter with a one-line change in a settings 
file, for example. We heavily rely on rc.conf.d functionality for this. 
We may put flags in there too.


I don't think putting name=YES into /etc/rc.conf.d/name is wrong or 
working by luck in general even if it is working by implication.


I think the "load_rc_config_var npf npf" line I've proposed in npf_boot 
is a neat solution (and similar for pf_boot). It basically says get the 
value of npf from wherever you may find it. It also avoids potential 
contamination of the environment compared to my original fix.


The split of /etc/rc.d/npf into two stages is analogous to swap1 and 
swap2. In that case, those scripts explicitly load_rc_config swap and do 
not take name into account.



--
Stephen


Re: CVS commit: src/etc/rc.d

2021-11-30 Thread Martin Husemann
On Tue, Nov 30, 2021 at 10:11:36AM +, Stephen Borrill wrote:
> In our products, we have a standard rc.conf and then a series of build
> scripts that configure and enable/disable services as required. We can
> switch between npf and ipfilter with a one-line change in a settings file,
> for example. We heavily rely on rc.conf.d functionality for this. We may put
> flags in there too.

You could achive that too by including "local" files from your generic 
/etc/rc.conf (like: ". /etc/conf/firewall", maybe even guarded by tests
for existance).

> I don't think putting name=YES into /etc/rc.conf.d/name is wrong or working
> by luck in general even if it is working by implication.

If we want to support that, we should document it and have tests for
it. Currently I would not guess this could work after reading the manual,
and would not think about such usage when extending/modifying anything in
/etc/rc*.

> I think the "load_rc_config_var npf npf" line I've proposed in npf_boot is a
> neat solution (and similar for pf_boot). It basically says get the value of
> npf from wherever you may find it. It also avoids potential contamination of
> the environment compared to my original fix.

Yes, and I am not objecting that detail.

> The split of /etc/rc.d/npf into two stages is analogous to swap1 and swap2.
> In that case, those scripts explicitly load_rc_config swap and do not take
> name into account.

We should ammend the documentation Robert cited to say something like
"in general $name, but in exceptional cases a well known service name
is used instead (like: swap, npf, ...)".

Martin


CVS commit: src/etc/rc.d

2021-11-30 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Nov 30 11:00:29 UTC 2021

Modified Files:
src/etc/rc.d: npf_boot pf_boot

Log Message:
Revert previous. Explicitly load the value of npf or pf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/etc/rc.d/npf_boot
cvs rdiff -u -r1.8 -r1.9 src/etc/rc.d/pf_boot

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

Modified files:

Index: src/etc/rc.d/npf_boot
diff -u src/etc/rc.d/npf_boot:1.5 src/etc/rc.d/npf_boot:1.6
--- src/etc/rc.d/npf_boot:1.5	Fri Nov 26 13:11:36 2021
+++ src/etc/rc.d/npf_boot	Tue Nov 30 11:00:29 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: npf_boot,v 1.5 2021/11/26 13:11:36 sborrill Exp $
+# $NetBSD: npf_boot,v 1.6 2021/11/30 11:00:29 sborrill Exp $
 #
 
 # PROVIDE: npf_boot
@@ -29,5 +29,6 @@ npf_boot_start()
 	/sbin/npfctl start
 }
 
-load_rc_config $rcvar
+load_rc_config $name
+load_rc_config_var npf npf
 run_rc_command "$1"

Index: src/etc/rc.d/pf_boot
diff -u src/etc/rc.d/pf_boot:1.8 src/etc/rc.d/pf_boot:1.9
--- src/etc/rc.d/pf_boot:1.8	Fri Nov 26 13:11:36 2021
+++ src/etc/rc.d/pf_boot	Tue Nov 30 11:00:29 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: pf_boot,v 1.8 2021/11/26 13:11:36 sborrill Exp $
+# $NetBSD: pf_boot,v 1.9 2021/11/30 11:00:29 sborrill Exp $
 #
 
 # PROVIDE: pf_boot
@@ -29,5 +29,6 @@ pf_boot_start()
 	/sbin/pfctl -q -e
 }
 
-load_rc_config $rcvar
+load_rc_config $name
+load_rc_config_var pf pf
 run_rc_command "$1"



CVS commit: src/etc/rc.d

2021-11-30 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Nov 30 11:00:29 UTC 2021

Modified Files:
src/etc/rc.d: npf_boot pf_boot

Log Message:
Revert previous. Explicitly load the value of npf or pf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/etc/rc.d/npf_boot
cvs rdiff -u -r1.8 -r1.9 src/etc/rc.d/pf_boot

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



CVS commit: [netbsd-9] src/sys/dev/pci

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:44:39 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c

Log Message:
Apply patch, requested by msaitoh in ticket #1378:

sys/dev/pci/piixpm.cpatch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/dev/pci/piixpm.c

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



CVS commit: [netbsd-9] src/sys/dev/pci

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:44:39 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c

Log Message:
Apply patch, requested by msaitoh in ticket #1378:

sys/dev/pci/piixpm.cpatch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/dev/pci/piixpm.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.54.2.1 src/sys/dev/pci/piixpm.c:1.54.2.2
--- src/sys/dev/pci/piixpm.c:1.54.2.1	Thu Jul 16 12:39:11 2020
+++ src/sys/dev/pci/piixpm.c	Tue Nov 30 11:44:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.54.2.1 2020/07/16 12:39:11 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.1 2020/07/16 12:39:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $");
 
 #include 
 #include 
@@ -123,6 +123,8 @@ static bool	piixpm_resume(device_t, cons
 
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
+static int	piixpm_i2c_sb600_acquire_bus(void *, int);
+static void	piixpm_i2c_sb600_release_bus(void *, int);
 static int	piixpm_i2c_sb800_acquire_bus(void *, int);
 static void	piixpm_i2c_sb800_release_bus(void *, int);
 static int	piixpm_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
@@ -338,8 +340,8 @@ piixpm_rescan(device_t self, const char 
 			tag->ic_acquire_bus = piixpm_i2c_sb800_acquire_bus;
 			tag->ic_release_bus = piixpm_i2c_sb800_release_bus;
 		} else {
-			tag->ic_acquire_bus = NULL;
-			tag->ic_release_bus = NULL;
+			tag->ic_acquire_bus = piixpm_i2c_sb600_acquire_bus;
+			tag->ic_release_bus = piixpm_i2c_sb600_release_bus;
 		}
 		tag->ic_exec = piixpm_i2c_exec;
 		memset(&iba, 0, sizeof(iba));
@@ -487,6 +489,28 @@ piixpm_csb5_reset(void *arg)
 }
 
 static int
+piixpm_i2c_sb600_acquire_bus(void *cookie, int flags)
+{
+	struct piixpm_smbus *smbus = cookie;
+	struct piixpm_softc *sc = smbus->softc;
+
+	if (!cold)
+		mutex_enter(&sc->sc_i2c_mutex);
+
+	return 0;
+}
+
+static void
+piixpm_i2c_sb600_release_bus(void *cookie, int flags)
+{
+	struct piixpm_smbus *smbus = cookie;
+	struct piixpm_softc *sc = smbus->softc;
+
+	if (!cold)
+		mutex_exit(&sc->sc_i2c_mutex);
+}
+
+static int
 piixpm_i2c_sb800_acquire_bus(void *cookie, int flags)
 {
 	struct piixpm_smbus *smbus = cookie;



CVS commit: [netbsd-9] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:46:23 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1378


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:46:23 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1378


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-9.3

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-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.52 src/doc/CHANGES-9.3:1.1.2.53
--- src/doc/CHANGES-9.3:1.1.2.52	Fri Nov 26 18:10:36 2021
+++ src/doc/CHANGES-9.3	Tue Nov 30 11:46:22 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.52 2021/11/26 18:10:36 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.53 2021/11/30 11:46:22 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -976,3 +976,8 @@ distrib/notes/common/main			1.566,1.567
 	explaining the legacy amd64-bios-install image.
 	[gutteridge, ticket #1376]
  
+sys/dev/pci/piixpm.cpatch
+
+	PR 56525: fix a bug that I2C access panics on old AMD chipset
+	(e.g SB600).
+	[msaitoh, ticket #1378]



CVS commit: [netbsd-8] src/sys/dev/pci

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:48:29 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c

Log Message:
Apply patch, requested by msaitoh in ticket #1709:

sys/dev/pci/piixpm.cpatch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.


To generate a diff of this commit:
cvs rdiff -u -r1.52.6.2 -r1.52.6.3 src/sys/dev/pci/piixpm.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:48:29 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c

Log Message:
Apply patch, requested by msaitoh in ticket #1709:

sys/dev/pci/piixpm.cpatch

Fix a bug that I2C access panics on old AMD chipset (e.g SB600).
Fixes PR kern/56525.


To generate a diff of this commit:
cvs rdiff -u -r1.52.6.2 -r1.52.6.3 src/sys/dev/pci/piixpm.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.52.6.2 src/sys/dev/pci/piixpm.c:1.52.6.3
--- src/sys/dev/pci/piixpm.c:1.52.6.2	Wed Aug  5 16:11:56 2020
+++ src/sys/dev/pci/piixpm.c	Tue Nov 30 11:48:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.52.6.2 2020/08/05 16:11:56 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.52.6.3 2021/11/30 11:48:29 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52.6.2 2020/08/05 16:11:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52.6.3 2021/11/30 11:48:29 martin Exp $");
 
 #include 
 #include 
@@ -123,6 +123,8 @@ static bool	piixpm_resume(device_t, cons
 
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
+static int	piixpm_i2c_sb600_acquire_bus(void *, int);
+static void	piixpm_i2c_sb600_release_bus(void *, int);
 static int	piixpm_i2c_sb800_acquire_bus(void *, int);
 static void	piixpm_i2c_sb800_release_bus(void *, int);
 static int	piixpm_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
@@ -338,8 +340,8 @@ piixpm_rescan(device_t self, const char 
 			tag->ic_acquire_bus = piixpm_i2c_sb800_acquire_bus;
 			tag->ic_release_bus = piixpm_i2c_sb800_release_bus;
 		} else {
-			tag->ic_acquire_bus = NULL;
-			tag->ic_release_bus = NULL;
+			tag->ic_acquire_bus = piixpm_i2c_sb600_acquire_bus;
+			tag->ic_release_bus = piixpm_i2c_sb600_release_bus;
 		}
 		tag->ic_exec = piixpm_i2c_exec;
 		memset(&iba, 0, sizeof(iba));
@@ -487,6 +489,28 @@ piixpm_csb5_reset(void *arg)
 }
 
 static int
+piixpm_i2c_sb600_acquire_bus(void *cookie, int flags)
+{
+	struct piixpm_smbus *smbus = cookie;
+	struct piixpm_softc *sc = smbus->softc;
+
+	if (!cold)
+		mutex_enter(&sc->sc_i2c_mutex);
+
+	return 0;
+}
+
+static void
+piixpm_i2c_sb600_release_bus(void *cookie, int flags)
+{
+	struct piixpm_smbus *smbus = cookie;
+	struct piixpm_softc *sc = smbus->softc;
+
+	if (!cold)
+		mutex_exit(&sc->sc_i2c_mutex);
+}
+
+static int
 piixpm_i2c_sb800_acquire_bus(void *cookie, int flags)
 {
 	struct piixpm_smbus *smbus = cookie;



CVS commit: [netbsd-8] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:49:40 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1709


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.109 -r1.1.2.110 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 11:49:40 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1709


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.109 -r1.1.2.110 src/doc/CHANGES-8.3

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-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.109 src/doc/CHANGES-8.3:1.1.2.110
--- src/doc/CHANGES-8.3:1.1.2.109	Sat Nov 20 15:22:35 2021
+++ src/doc/CHANGES-8.3	Tue Nov 30 11:49:40 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.109 2021/11/20 15:22:35 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.110 2021/11/30 11:49:40 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2215,3 +2215,8 @@ sys/dev/pci/ixgbe/ix_txrx.c			1.94
 	- Use macro. Fix typos in comment.
 	[msaitoh, ticket #1708]
 
+sys/dev/pci/piixpm.cpatch
+
+	PR 56525: fix a bug that I2C access panics on old AMD chipset
+	(e.g SB600).
+	[msaitoh, ticket #1709]



CVS commit: src/usr.bin/msgs

2021-11-30 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov 30 12:03:38 UTC 2021

Modified Files:
src/usr.bin/msgs: pathnames.h

Log Message:
msgs(1): avoid executing /usr/bin/Mail, it no longer exists.

https://groups.google.com/g/comp.unix.bsd.netbsd.misc/c/Yni35VNCXOY


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/msgs/pathnames.h

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



CVS commit: src/usr.bin/msgs

2021-11-30 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov 30 12:03:38 UTC 2021

Modified Files:
src/usr.bin/msgs: pathnames.h

Log Message:
msgs(1): avoid executing /usr/bin/Mail, it no longer exists.

https://groups.google.com/g/comp.unix.bsd.netbsd.misc/c/Yni35VNCXOY


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/msgs/pathnames.h

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/msgs/pathnames.h
diff -u src/usr.bin/msgs/pathnames.h:1.4 src/usr.bin/msgs/pathnames.h:1.5
--- src/usr.bin/msgs/pathnames.h:1.4	Thu Aug  7 11:15:18 2003
+++ src/usr.bin/msgs/pathnames.h	Tue Nov 30 12:03:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pathnames.h,v 1.4 2003/08/07 11:15:18 agc Exp $	*/
+/*	$NetBSD: pathnames.h,v 1.5 2021/11/30 12:03:38 nia Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
  */
 
 #define	_PATH_MSGS	"/var/msgs"
-#define	_PATH_MAIL	"/usr/bin/Mail -f %s"
+#define	_PATH_MAIL	"/usr/bin/mailx -f %s"
 #define	_PATH_PAGER	"/usr/bin/more -%d"
 #undef _PATH_TMP
 #define	_PATH_TMP	"/tmp/msgXX"



CVS commit: src/lib/librefuse

2021-11-30 Thread Masatake Daimon
Module Name:src
Committed By:   pho
Date:   Tue Nov 30 12:13:12 UTC 2021

Modified Files:
src/lib/librefuse: refuse.c

Log Message:
Move the call of fuse_operations::init() from fuse_new() to fuse_loop()

Prior to this change we were calling init() before daemonizing the
process. Some filesystems call chdir(2) in init() but fuse_daemonize()
call chdir("/"), which breaks assumptions about the state of the
process.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/lib/librefuse/refuse.c

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



CVS commit: src/lib/librefuse

2021-11-30 Thread Masatake Daimon
Module Name:src
Committed By:   pho
Date:   Tue Nov 30 12:13:12 UTC 2021

Modified Files:
src/lib/librefuse: refuse.c

Log Message:
Move the call of fuse_operations::init() from fuse_new() to fuse_loop()

Prior to this change we were calling init() before daemonizing the
process. Some filesystems call chdir(2) in init() but fuse_daemonize()
call chdir("/"), which breaks assumptions about the state of the
process.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/lib/librefuse/refuse.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/librefuse/refuse.c
diff -u src/lib/librefuse/refuse.c:1.101 src/lib/librefuse/refuse.c:1.102
--- src/lib/librefuse/refuse.c:1.101	Mon Sep 23 12:00:57 2019
+++ src/lib/librefuse/refuse.c	Tue Nov 30 12:13:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: refuse.c,v 1.101 2019/09/23 12:00:57 christos Exp $	*/
+/*	$NetBSD: refuse.c,v 1.102 2021/11/30 12:13:12 pho Exp $	*/
 
 /*
  * Copyright © 2007 Alistair Crooks.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: refuse.c,v 1.101 2019/09/23 12:00:57 christos Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.102 2021/11/30 12:13:12 pho Exp $");
 #endif /* !lint */
 
 #include 
@@ -1276,9 +1276,6 @@ fuse_new(struct fuse_args *args,
 	fusectx->pid = 0;
 	fusectx->private_data = userdata;
 
-	if (fuse->op.init != NULL)
-		fusectx->private_data = fuse->op.init(NULL); /* XXX */
-
 	/* initialise the puffs operations structure */
 PUFFSOP_INIT(pops);
 
@@ -1328,6 +1325,18 @@ fuse_new(struct fuse_args *args,
 int
 fuse_loop(struct fuse *fuse)
 {
+	if (fuse->op.init != NULL) {
+		struct fuse_context *fusectx = fuse_get_context();
+
+		/* XXX: prototype incompatible with FUSE: a secondary argument
+		 * of struct fuse_config* needs to be passed.
+		 *
+		 * XXX: Our struct fuse_conn_info is not fully compatible with
+		 * the FUSE one.
+		 */
+		fusectx->private_data = fuse->op.init(NULL);
+	}
+
 	return puffs_mainloop(fuse->pu);
 }
 



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

2021-11-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 30 12:32:10 UTC 2021

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

Log Message:
lint uses the gcc assembly syntax


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c

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



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

2021-11-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 30 12:32:10 UTC 2021

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

Log Message:
lint uses the gcc assembly syntax


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c

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

Modified files:

Index: src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c
diff -u src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.9 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.10
--- src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.9	Sun Jan 20 18:14:16 2019
+++ src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c	Tue Nov 30 07:32:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitNativeX86_common.c,v 1.9 2019/01/20 23:14:16 alnsn Exp $	*/
+/*	$NetBSD: sljitNativeX86_common.c,v 1.10 2021/11/30 12:32:09 christos Exp $	*/
 
 /*
  *Stack-less Just-In-Time compiler
@@ -317,7 +317,7 @@ static void get_cpu_features(void)
 	__cpuid(CPUInfo, 1);
 	features = (sljit_u32)CPUInfo[3];
 
-#elif defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_C)
+#elif defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_C) || defined(__lint__)
 
 	/* AT&T syntax. */
 	__asm__ (



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2021-11-30 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 30 12:37:38 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vfsops.c

Log Message:
In zfs_statvfs(), set f_bresvd and f_fresvd to 0.  Fixes random kernel
accounting suspend/resumes with erroneous values leaking out.

Note: no userland leakage as statvfs(2) handler memset 0's the buffer.

XXX: Should be fixed with a memset in VFS_STATVFS().


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.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/dist/uts/common/fs/zfs/zfs_vfsops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.29 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.30
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.29	Thu Aug 27 09:57:33 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c	Tue Nov 30 12:37:38 2021
@@ -2182,6 +2182,7 @@ zfs_statvfs(vfs_t *vfsp, struct statvfs 
 	statp->f_blocks = (refdbytes + availbytes) >> SPA_MINBLOCKSHIFT;
 	statp->f_bfree = availbytes / statp->f_bsize;
 	statp->f_bavail = statp->f_bfree; /* no root reservation */
+	statp->f_bresvd = 0;
 
 	/*
 	 * statvfs() should really be called statufs(), because it assumes
@@ -2196,6 +2197,7 @@ zfs_statvfs(vfs_t *vfsp, struct statvfs 
 	statp->f_favail = statp->f_ffree;	/* no "root reservation" */
 #endif
 	statp->f_files = statp->f_ffree + usedobjs;
+	statp->f_fresvd = 0;
 
 #ifdef __FreeBSD__
 	(void) cmpldev(&d32, vfsp->vfs_dev);



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2021-11-30 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 30 12:37:38 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vfsops.c

Log Message:
In zfs_statvfs(), set f_bresvd and f_fresvd to 0.  Fixes random kernel
accounting suspend/resumes with erroneous values leaking out.

Note: no userland leakage as statvfs(2) handler memset 0's the buffer.

XXX: Should be fixed with a memset in VFS_STATVFS().


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c

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



CVS commit: [netbsd-9] src/usr.bin/msgs

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 13:11:47 UTC 2021

Modified Files:
src/usr.bin/msgs [netbsd-9]: pathnames.h

Log Message:
Pull up following revision(s) (requested by nia in ticket #1379):

usr.bin/msgs/pathnames.h: revision 1.5

msgs(1): avoid executing /usr/bin/Mail, it no longer exists.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.100.1 src/usr.bin/msgs/pathnames.h

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



CVS commit: [netbsd-9] src/usr.bin/msgs

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 13:11:47 UTC 2021

Modified Files:
src/usr.bin/msgs [netbsd-9]: pathnames.h

Log Message:
Pull up following revision(s) (requested by nia in ticket #1379):

usr.bin/msgs/pathnames.h: revision 1.5

msgs(1): avoid executing /usr/bin/Mail, it no longer exists.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.100.1 src/usr.bin/msgs/pathnames.h

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/msgs/pathnames.h
diff -u src/usr.bin/msgs/pathnames.h:1.4 src/usr.bin/msgs/pathnames.h:1.4.100.1
--- src/usr.bin/msgs/pathnames.h:1.4	Thu Aug  7 11:15:18 2003
+++ src/usr.bin/msgs/pathnames.h	Tue Nov 30 13:11:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pathnames.h,v 1.4 2003/08/07 11:15:18 agc Exp $	*/
+/*	$NetBSD: pathnames.h,v 1.4.100.1 2021/11/30 13:11:47 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
  */
 
 #define	_PATH_MSGS	"/var/msgs"
-#define	_PATH_MAIL	"/usr/bin/Mail -f %s"
+#define	_PATH_MAIL	"/usr/bin/mailx -f %s"
 #define	_PATH_PAGER	"/usr/bin/more -%d"
 #undef _PATH_TMP
 #define	_PATH_TMP	"/tmp/msgXX"



CVS commit: [netbsd-9] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 13:13:10 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1379


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-9.3

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-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.53 src/doc/CHANGES-9.3:1.1.2.54
--- src/doc/CHANGES-9.3:1.1.2.53	Tue Nov 30 11:46:22 2021
+++ src/doc/CHANGES-9.3	Tue Nov 30 13:13:10 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.53 2021/11/30 11:46:22 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.54 2021/11/30 13:13:10 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -981,3 +981,9 @@ sys/dev/pci/piixpm.cpatch
 	PR 56525: fix a bug that I2C access panics on old AMD chipset
 	(e.g SB600).
 	[msaitoh, ticket #1378]
+
+usr.bin/msgs/pathnames.h			1.5
+
+	msgs(1): avoid executing /usr/bin/Mail, it no longer exists.
+	[nia, ticket #1379]
+



CVS commit: [netbsd-9] src/doc

2021-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 30 13:13:10 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1379


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-9.3

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



CVS commit: src/sys/dev/pci

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:18 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel Rocket Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1443 -r1.1444 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/dev/pci

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:18 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel Rocket Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1443 -r1.1444 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1443 src/sys/dev/pci/pcidevs:1.1444
--- src/sys/dev/pci/pcidevs:1.1443	Wed Nov  3 15:09:42 2021
+++ src/sys/dev/pci/pcidevs	Tue Nov 30 15:16:18 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1443 2021/11/03 15:09:42 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1444 2021/11/30 15:16:18 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5736,6 +5736,18 @@ product INTEL EHL_PSE_I2C_7	0x4bc0	Elkha
 product INTEL EHL_PSE_CAN_0	0x4bc1	Elkhart Lake PSE CAN 0
 product INTEL EHL_PSE_CAN_1	0x4bc2	Elkhart Lake PSE CAN 1
 product INTEL EHL_PSE_QEP_0	0x4bc3	Elkhart Lake PSE QEP 0
+product INTEL RKL_PCIE_RP_0	0x4c01	Rocket Lake PCIe Root Port 0 (x16)
+product INTEL RKL_DPTF		0x4c03	Rocket Lake DPTF
+product INTEL RKL_PCIE_RP_1	0x4c05	Rocket Lake PCIe Root Port 1 (x8)
+product INTEL RKL_PCIE_RP_2	0x4c07	Rocket Lake PCIe Root Port 2 (x4)
+product INTEL RKL_PCIE_RP_3	0x4c09	Rocket Lake PCIe Root Port 3 (x4)
+product INTEL RKL_GNA		0x4c11	Rocket Lake Gauss Newton Algorithm
+product INTEL RKL_8C_HOST	0x4c43	Rocket Lake (8Core) Host
+product INTEL RKL_6C_HOST	0x4c53	Rocket Lake (8Core) Host
+product INTEL RKL_IGD_1		0x4c8a	Rocket Lake UHD Graphics 750 (32EU)
+product INTEL RKL_IGD_2		0x4c8b	Rocket Lake UHD Graphics 730 (24EU)
+product INTEL RKL_IGD_3		0x4c90	Rocket Lake (Xeon W) UHD Graphics 750
+product INTEL RKL_IGD_4		0x4c9a	Rocket Lake (Xeon E) UHD Graphics 750
 product INTEL JSL_ESPI		0x4d87	Jasper Lake eSPI
 product INTEL JSL_P2SB		0x4da0	Jasper Lake P2SB
 product INTEL JSL_PMC		0x4da1	Jasper Lake PMC



CVS commit: src/sys/dev/pci

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:42 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1428 -r1.1429 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1427 -r1.1428 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 20:48:01 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varmod-assign.exp varmod-assign.mk

Log Message:
tests/make: convert tests for modifier '::=' to parse time

This puts the expected result of the expressions closer to the
expressions, making the tests self-contained.

The error messages that used to produce trailing spaces have been fixed
in var.c 1.853 from 2021-02-23. The error message now encloses the
variable name in quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/varmod-assign.exp
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/varmod-assign.mk

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/unit-tests/varmod-assign.exp
diff -u src/usr.bin/make/unit-tests/varmod-assign.exp:1.16 src/usr.bin/make/unit-tests/varmod-assign.exp:1.17
--- src/usr.bin/make/unit-tests/varmod-assign.exp:1.16	Tue Apr  6 01:38:39 2021
+++ src/usr.bin/make/unit-tests/varmod-assign.exp	Tue Nov 30 20:48:01 2021
@@ -12,18 +12,6 @@ Var_Parse: ${${VARNAME}} != "assigned-va
 Var_Parse: ${VARNAME}} != "assigned-value" (eval-defined)
 Global: .MAKEFLAGS =  -r -k -d v -d
 Global: .MAKEFLAGS =  -r -k -d v -d 0
-mod-assign: first=1.
-mod-assign: last=3.
-mod-assign: appended=1 2 3.
-1
-2
-3
-mod-assign: ran:3.
-mod-assign: global: 1, 3, 1 2 3, 3.
-mod-assign-nested: then1t1
-mod-assign-nested: else2e2
-mod-assign-nested: then3t3
-mod-assign-nested: else4e4
 make: Bad modifier ":" for variable ""
 mod-assign-empty: value}
 make: Bad modifier ":" for variable ""

Index: src/usr.bin/make/unit-tests/varmod-assign.mk
diff -u src/usr.bin/make/unit-tests/varmod-assign.mk:1.12 src/usr.bin/make/unit-tests/varmod-assign.mk:1.13
--- src/usr.bin/make/unit-tests/varmod-assign.mk:1.12	Mon Mar 15 18:56:38 2021
+++ src/usr.bin/make/unit-tests/varmod-assign.mk	Tue Nov 30 20:48:01 2021
@@ -1,70 +1,79 @@
-# $NetBSD: varmod-assign.mk,v 1.12 2021/03/15 18:56:38 rillig Exp $
+# $NetBSD: varmod-assign.mk,v 1.13 2021/11/30 20:48:01 rillig Exp $
 #
 # Tests for the obscure ::= variable modifiers, which perform variable
 # assignments during evaluation, just like the = operator in C.
 
-all:	mod-assign
-all:	mod-assign-nested
 all:	mod-assign-empty
 all:	mod-assign-parse
 all:	mod-assign-shell-error
 
-mod-assign:
-	# The ::?= modifier applies the ?= assignment operator 3 times.
-	# The ?= operator only has an effect for the first time, therefore
-	# the variable FIRST ends up with the value 1.
-	@echo $@: ${1 2 3:L:@i@${FIRST::?=$i}@} first=${FIRST}.
-
-	# The ::= modifier applies the = assignment operator 3 times.
-	# The = operator overwrites the previous value, therefore the
-	# variable LAST ends up with the value 3.
-	@echo $@: ${1 2 3:L:@i@${LAST::=$i}@} last=${LAST}.
-
-	# The ::+= modifier applies the += assignment operator 3 times.
-	# The += operator appends 3 times to the variable, therefore
-	# the variable APPENDED ends up with the value "1 2 3".
-	@echo $@: ${1 2 3:L:@i@${APPENDED::+=$i}@} appended=${APPENDED}.
-
-	# The ::!= modifier applies the != assignment operator 3 times.
-	# The side effects of the shell commands are visible in the output.
-	# Just as with the ::= modifier, the last value is stored in the
-	# RAN variable.
-	@echo $@: ${echo.1 echo.2 echo.3:L:@i@${RAN::!=${i:C,.*,&; & 1>\&2,:S,., ,g}}@} ran:${RAN}.
-
-	# The assignments happen in the global scope and thus are
-	# preserved even after the shell command has been run.
-	@echo $@: global: ${FIRST:Q}, ${LAST:Q}, ${APPENDED:Q}, ${RAN:Q}.
-
-mod-assign-nested:
-	# The condition "1" is true, therefore THEN1 gets assigned a value,
-	# and IT1 as well.  Nothing surprising here.
-	@echo $@: ${1:?${THEN1::=then1${IT1::=t1}}:${ELSE1::=else1${IE1::=e1}}}${THEN1}${ELSE1}${IT1}${IE1}
-
-	# The condition "0" is false, therefore ELSE1 gets assigned a value,
-	# and IE1 as well.  Nothing surprising here as well.
-	@echo $@: ${0:?${THEN2::=then2${IT2::=t2}}:${ELSE2::=else2${IE2::=e2}}}${THEN2}${ELSE2}${IT2}${IE2}
-
-	# The same effects happen when the variables are defined elsewhere.
-	@echo $@: ${SINK3:Q}
-	@echo $@: ${SINK4:Q}
+# The modifier '::?=' applies the assignment operator '?=' 3 times. The
+# operator '?=' only has an effect for the first time, therefore the variable
+# FIRST ends up with the value 1.
+.if "${1 2 3:L:@i@${FIRST::?=$i}@} first=${FIRST}" != " first=1"
+.  error
+.endif
+
+# The modifier '::=' applies the assignment operator '=' 3 times. The
+# operator '=' overwrites the previous value, therefore the variable LAST ends
+# up with the value 3.
+.if "${1 2 3:L:@i@${LAST::=$i}@} last=${LAST}" != " last=3"
+.  error
+.endif
+
+# The modifier '::+=' applies the assignment operator '+=' 3 times. The
+# operator '+=' appends 3 times to the variable, therefore the variable
+# APPENDED ends up with the value "1 2 3".
+.if "${1 2 

CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 20:48:01 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varmod-assign.exp varmod-assign.mk

Log Message:
tests/make: convert tests for modifier '::=' to parse time

This puts the expected result of the expressions closer to the
expressions, making the tests self-contained.

The error messages that used to produce trailing spaces have been fixed
in var.c 1.853 from 2021-02-23. The error message now encloses the
variable name in quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/varmod-assign.exp
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/varmod-assign.mk

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



CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 23:52:19 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: var-op-expand.exp var-op-expand.mk
varmisc.mk varmod-defined.mk varmod-loop-varname.exp
varmod-loop-varname.mk varmod-loop.exp varmod-loop.mk
varname-dot-make-save_dollars.mk

Log Message:
tests/make: test and document .MAKE.SAVE_DOLLARS and ':='


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/var-op-expand.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/var-op-expand.mk
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/unit-tests/varmisc.mk
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-defined.mk
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-loop-varname.exp \
src/usr.bin/make/unit-tests/varmod-loop-varname.mk \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-loop.exp
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmod-loop.mk

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



CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 23:52:19 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: var-op-expand.exp var-op-expand.mk
varmisc.mk varmod-defined.mk varmod-loop-varname.exp
varmod-loop-varname.mk varmod-loop.exp varmod-loop.mk
varname-dot-make-save_dollars.mk

Log Message:
tests/make: test and document .MAKE.SAVE_DOLLARS and ':='


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/var-op-expand.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/var-op-expand.mk
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/unit-tests/varmisc.mk
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-defined.mk
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-loop-varname.exp \
src/usr.bin/make/unit-tests/varmod-loop-varname.mk \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-loop.exp
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmod-loop.mk

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/unit-tests/var-op-expand.exp
diff -u src/usr.bin/make/unit-tests/var-op-expand.exp:1.5 src/usr.bin/make/unit-tests/var-op-expand.exp:1.6
--- src/usr.bin/make/unit-tests/var-op-expand.exp:1.5	Sat Nov 20 17:47:33 2021
+++ src/usr.bin/make/unit-tests/var-op-expand.exp	Tue Nov 30 23:52:19 2021
@@ -1,7 +1,7 @@
-make: "var-op-expand.mk" line 259: Unknown modifier "s,value,replaced,"
-make: "var-op-expand.mk" line 262: warning: XXX Neither branch should be taken.
-make: "var-op-expand.mk" line 267: Unknown modifier "s,value,replaced,"
+make: "var-op-expand.mk" line 265: Unknown modifier "s,value,replaced,"
 make: "var-op-expand.mk" line 268: warning: XXX Neither branch should be taken.
+make: "var-op-expand.mk" line 273: Unknown modifier "s,value,replaced,"
+make: "var-op-expand.mk" line 274: warning: XXX Neither branch should be taken.
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/var-op-expand.mk
diff -u src/usr.bin/make/unit-tests/var-op-expand.mk:1.14 src/usr.bin/make/unit-tests/var-op-expand.mk:1.15
--- src/usr.bin/make/unit-tests/var-op-expand.mk:1.14	Sat Nov 20 17:47:33 2021
+++ src/usr.bin/make/unit-tests/var-op-expand.mk	Tue Nov 30 23:52:19 2021
@@ -1,8 +1,14 @@
-# $NetBSD: var-op-expand.mk,v 1.14 2021/11/20 17:47:33 rillig Exp $
+# $NetBSD: var-op-expand.mk,v 1.15 2021/11/30 23:52:19 rillig Exp $
 #
 # Tests for the := variable assignment operator, which expands its
 # right-hand side.
+#
+# See also:
+#	varname-dot-make-save_dollars.mk
 
+# Force the test results to be independent of the default value of this
+# setting, which is 'yes' for NetBSD's usr.bin/make but 'no' for the bmake
+# distribution and pkgsrc/devel/bmake.
 .MAKE.SAVE_DOLLARS:=  yes
 
 # If the right-hand side does not contain a dollar sign, the ':=' assignment

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.30 src/usr.bin/make/unit-tests/varmisc.mk:1.31
--- src/usr.bin/make/unit-tests/varmisc.mk:1.30	Thu Feb  4 21:42:47 2021
+++ src/usr.bin/make/unit-tests/varmisc.mk	Tue Nov 30 23:52:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: varmisc.mk,v 1.30 2021/02/04 21:42:47 rillig Exp $
+# $NetBSD: varmisc.mk,v 1.31 2021/11/30 23:52:19 rillig Exp $
 #
 # Miscellaneous variable tests.
 
@@ -65,7 +65,7 @@ cmpv:
 	@echo Literal=3.4.5 == ${3.4.5:L:${M_cmpv}}
 	@echo We have ${${.TARGET:T}.only}
 
-# catch misshandling of nested vars in .for loop
+# catch mishandling of nested variables in .for loop
 MAN=
 MAN1=	make.1
 .for s in 1 2
@@ -77,12 +77,13 @@ MAN+=	${MAN$s}
 manok:
 	@echo MAN=${MAN}
 
+# Test parsing of boolean values.
 # begin .MAKE.SAVE_DOLLARS; see Var_SetWithFlags and ParseBoolean.
 SD_VALUES=	0 1 2 False True false true Yes No yes no On Off ON OFF on off
 SD_4_DOLLARS=	
 
 .for val in ${SD_VALUES}
-.MAKE.SAVE_DOLLARS:=	${val}	# Must be := since a simple = has no effect.
+.MAKE.SAVE_DOLLARS:=	${val}	# Must be := since a simple '=' has no effect.
 SD.${val}:=		${SD_4_DOLLARS}
 .endfor
 .MAKE.SAVE_DOLLARS:=	yes
@@ -91,6 +92,7 @@ save-dollars:
 .for val in ${SD_VALUES}
 	@printf '%s: %-8s = %s\n' $@ ${val} ${SD.${val}:Q}
 .endfor
+# end .MAKE.SAVE_DOLLARS
 
 # Appending to an undefined variable does not add a space in front.
 .undef APPENDED

Index: src/usr.bin/make/unit-tests/varmod-defined.mk
diff -u src/usr.bin/make/unit-tests/varmod-defined.mk:1.11 src/usr.bin/make/unit-tests/varmod-defined.mk:1.12
--- src/usr.bin/make/unit-tests/varmod-defined.mk:1.11	Sun Apr 11 13:35:56 2021
+++ src/usr.bin/make/unit-tests/varmod-defined.mk	Tue Nov 30 23:52:19 2021
@@ -1,8 +1,11 @@
-# $NetBSD: varmod-defined.mk,v 1.11 2021/04/11 13:35:56 rillig Exp $
+# $NetBSD: varmod-defined.mk,v 1.12 2021/11/30 23:

CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 23:58:10 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-make-save_dollars.mk

Log Message:
tests/make: document that undefining .MAKE.SAVE_DOLLARS has no effect


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk

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



CVS commit: src/usr.bin/make/unit-tests

2021-11-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 30 23:58:10 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-make-save_dollars.mk

Log Message:
tests/make: document that undefining .MAKE.SAVE_DOLLARS has no effect


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk

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/unit-tests/varname-dot-make-save_dollars.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.3 src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.4
--- src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.3	Tue Nov 30 23:52:19 2021
+++ src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk	Tue Nov 30 23:58:10 2021
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-make-save_dollars.mk,v 1.3 2021/11/30 23:52:19 rillig Exp $
+# $NetBSD: varname-dot-make-save_dollars.mk,v 1.4 2021/11/30 23:58:10 rillig Exp $
 #
 # Tests for the special .MAKE.SAVE_DOLLARS variable, which controls whether
 # the assignment operator ':=' converts '$$' to a single '$' or keeps it
@@ -51,9 +51,28 @@ VAR:=		-${.MAKE.SAVE_DOLLARS::=yes}-
 
 # The '$' from the ':U' expressions are indirect, therefore SAVE_DOLLARS
 # doesn't apply to them.
+.MAKE.SAVE_DOLLARS=	no
 VAR:=		${:U\$\$\$\$}-${.MAKE.SAVE_DOLLARS::=yes}-${:U\$\$\$\$}
 .if ${VAR} != "\$\$--\$\$"
 .  error
 .endif
 
+# Undefining .MAKE.SAVE_DOLLARS does not have any effect, in particular it
+# does not restore the default behavior.
+.MAKE.SAVE_DOLLARS=	no
+.undef .MAKE.SAVE_DOLLARS
+VAR:=		
+.if ${VAR} != "\$\$"
+.  error
+.endif
+
+# Undefining .MAKE.SAVE_DOLLARS does not have any effect, in particular it
+# does not restore the default behavior.
+.MAKE.SAVE_DOLLARS=	yes
+.undef .MAKE.SAVE_DOLLARS
+VAR:=		
+.if ${VAR} != "\$\$\$\$"
+.  error
+.endif
+
 all: