CVS commit: src/usr.bin/script

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 19:49:51 UTC 2022

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

Log Message:
dooutput can return if finish() does not find a chile process.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/script/script.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/script/script.c
diff -u src/usr.bin/script/script.c:1.29 src/usr.bin/script/script.c:1.30
--- src/usr.bin/script/script.c:1.29	Sun Jan 16 14:04:00 2022
+++ src/usr.bin/script/script.c	Thu Jan 20 14:49:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: script.c,v 1.29 2022/01/16 19:04:00 christos Exp $	*/
+/*	$NetBSD: script.c,v 1.30 2022/01/20 19:49:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)script.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: script.c,v 1.29 2022/01/16 19:04:00 christos Exp $");
+__RCSID("$NetBSD: script.c,v 1.30 2022/01/20 19:49:51 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -86,9 +86,9 @@ static int	isterm;
 static struct	termios tt;
 
 __dead static void	done(int);
-__dead static void	dooutput(void);
 __dead static void	doshell(const char *);
 __dead static void	fail(void);
+static void	dooutput(void);
 static void	finish(int);
 static void	scriptflush(int);
 static void	record(FILE *, char *, size_t, int);



CVS commit: src/usr.bin/script

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 19:49:51 UTC 2022

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

Log Message:
dooutput can return if finish() does not find a chile process.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/script/script.c

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

2022-01-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jan 20 19:24:53 UTC 2022

Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: dep-duplicate.exp dep-duplicate.mk

Log Message:
make: fix filename in warning about duplicate script (since 2018-12-22)


To generate a diff of this commit:
cvs rdiff -u -r1.652 -r1.653 src/usr.bin/make/parse.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dep-duplicate.exp \
src/usr.bin/make/unit-tests/dep-duplicate.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

2022-01-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jan 20 19:24:53 UTC 2022

Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: dep-duplicate.exp dep-duplicate.mk

Log Message:
make: fix filename in warning about duplicate script (since 2018-12-22)


To generate a diff of this commit:
cvs rdiff -u -r1.652 -r1.653 src/usr.bin/make/parse.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dep-duplicate.exp \
src/usr.bin/make/unit-tests/dep-duplicate.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/parse.c
diff -u src/usr.bin/make/parse.c:1.652 src/usr.bin/make/parse.c:1.653
--- src/usr.bin/make/parse.c:1.652	Sun Jan 16 09:41:28 2022
+++ src/usr.bin/make/parse.c	Thu Jan 20 19:24:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.652 2022/01/16 09:41:28 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.653 2022/01/20 19:24:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.652 2022/01/16 09:41:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.653 2022/01/20 19:24:53 rillig Exp $");
 
 /*
  * A file being read.
@@ -412,12 +412,12 @@ FindKeyword(const char *str)
 }
 
 static void
-PrintLocation(FILE *f, const char *fname, size_t lineno)
+PrintLocation(FILE *f, bool useVars, const char *fname, size_t lineno)
 {
 	char dirbuf[MAXPATHLEN + 1];
 	FStr dir, base;
 
-	if (fname[0] == '/' || strcmp(fname, "(stdin)") == 0) {
+	if (!useVars || fname[0] == '/' || strcmp(fname, "(stdin)") == 0) {
 		(void)fprintf(f, "\"%s\" line %u: ", fname, (unsigned)lineno);
 		return;
 	}
@@ -439,8 +439,8 @@ PrintLocation(FILE *f, const char *fname
 	FStr_Done();
 }
 
-static void MAKE_ATTR_PRINTFLIKE(5, 0)
-ParseVErrorInternal(FILE *f, const char *fname, size_t lineno,
+static void MAKE_ATTR_PRINTFLIKE(6, 0)
+ParseVErrorInternal(FILE *f, bool useVars, const char *fname, size_t lineno,
 		ParseErrorLevel type, const char *fmt, va_list ap)
 {
 	static bool fatal_warning_error_printed = false;
@@ -448,7 +448,7 @@ ParseVErrorInternal(FILE *f, const char 
 	(void)fprintf(f, "%s: ", progname);
 
 	if (fname != NULL)
-		PrintLocation(f, fname, lineno);
+		PrintLocation(f, useVars, fname, lineno);
 	if (type == PARSE_WARNING)
 		(void)fprintf(f, "warning: ");
 	(void)vfprintf(f, fmt, ap);
@@ -477,13 +477,13 @@ ParseErrorInternal(const char *fname, si
 
 	(void)fflush(stdout);
 	va_start(ap, fmt);
-	ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap);
+	ParseVErrorInternal(stderr, false, fname, lineno, type, fmt, ap);
 	va_end(ap);
 
 	if (opts.debug_file != stdout && opts.debug_file != stderr) {
 		va_start(ap, fmt);
-		ParseVErrorInternal(opts.debug_file, fname, lineno, type,
-		fmt, ap);
+		ParseVErrorInternal(opts.debug_file, false, fname, lineno,
+		type, fmt, ap);
 		va_end(ap);
 	}
 }
@@ -514,13 +514,13 @@ Parse_Error(ParseErrorLevel type, const 
 
 	(void)fflush(stdout);
 	va_start(ap, fmt);
-	ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap);
+	ParseVErrorInternal(stderr, true, fname, lineno, type, fmt, ap);
 	va_end(ap);
 
 	if (opts.debug_file != stdout && opts.debug_file != stderr) {
 		va_start(ap, fmt);
-		ParseVErrorInternal(opts.debug_file, fname, lineno, type,
-		fmt, ap);
+		ParseVErrorInternal(opts.debug_file, true, fname, lineno,
+		type, fmt, ap);
 		va_end(ap);
 	}
 }

Index: src/usr.bin/make/unit-tests/dep-duplicate.exp
diff -u src/usr.bin/make/unit-tests/dep-duplicate.exp:1.2 src/usr.bin/make/unit-tests/dep-duplicate.exp:1.3
--- src/usr.bin/make/unit-tests/dep-duplicate.exp:1.2	Thu Jan 20 19:16:25 2022
+++ src/usr.bin/make/unit-tests/dep-duplicate.exp	Thu Jan 20 19:24:53 2022
@@ -1,4 +1,4 @@
 make: "dep-duplicate.inc" line 1: warning: duplicate script for target "all" ignored
-make: "dep-duplicate.inc" line 3: warning: using previous script for "all" defined here
+make: "dep-duplicate.main" line 3: warning: using previous script for "all" defined here
 main-output
 exit status 0
Index: src/usr.bin/make/unit-tests/dep-duplicate.mk
diff -u src/usr.bin/make/unit-tests/dep-duplicate.mk:1.2 src/usr.bin/make/unit-tests/dep-duplicate.mk:1.3
--- src/usr.bin/make/unit-tests/dep-duplicate.mk:1.2	Thu Jan 20 19:16:25 2022
+++ src/usr.bin/make/unit-tests/dep-duplicate.mk	Thu Jan 20 19:24:53 2022
@@ -1,4 +1,4 @@
-# $NetBSD: dep-duplicate.mk,v 1.2 2022/01/20 19:16:25 rillig Exp $
+# $NetBSD: dep-duplicate.mk,v 1.3 2022/01/20 19:24:53 rillig Exp $
 #
 # Test for a target whose commands are defined twice.  This generates a
 # warning, not an error, so ensure that the correct commands are kept.
@@ -6,11 +6,7 @@
 # Also ensure that the diagnostics mention the correct file in case of
 # included files.  Since parse.c 1.231 from 2018-12-22 and before parse.c
 # 1.653 from 2022-01-20, the wrong filename had been 

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

2022-01-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jan 20 19:16:25 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: dep-duplicate.exp dep-duplicate.mk

Log Message:
tests/make: refine test for wrong diagnostic line

To trigger the faulty code path, the file where the targets gets its
first command must be included via its relative path.  That was the case
when running 'cd usr.bin/make && make test' but not when running the
tests via ATF.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dep-duplicate.exp \
src/usr.bin/make/unit-tests/dep-duplicate.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/dep-duplicate.exp
diff -u src/usr.bin/make/unit-tests/dep-duplicate.exp:1.1 src/usr.bin/make/unit-tests/dep-duplicate.exp:1.2
--- src/usr.bin/make/unit-tests/dep-duplicate.exp:1.1	Wed Jan 19 22:10:41 2022
+++ src/usr.bin/make/unit-tests/dep-duplicate.exp	Thu Jan 20 19:16:25 2022
@@ -1,4 +1,4 @@
 make: "dep-duplicate.inc" line 1: warning: duplicate script for target "all" ignored
-make: "dep-duplicate.inc" line 15: warning: using previous script for "all" defined here
-first
+make: "dep-duplicate.inc" line 3: warning: using previous script for "all" defined here
+main-output
 exit status 0
Index: src/usr.bin/make/unit-tests/dep-duplicate.mk
diff -u src/usr.bin/make/unit-tests/dep-duplicate.mk:1.1 src/usr.bin/make/unit-tests/dep-duplicate.mk:1.2
--- src/usr.bin/make/unit-tests/dep-duplicate.mk:1.1	Wed Jan 19 22:10:41 2022
+++ src/usr.bin/make/unit-tests/dep-duplicate.mk	Thu Jan 20 19:16:25 2022
@@ -1,21 +1,31 @@
-# $NetBSD: dep-duplicate.mk,v 1.1 2022/01/19 22:10:41 rillig Exp $
+# $NetBSD: dep-duplicate.mk,v 1.2 2022/01/20 19:16:25 rillig Exp $
 #
 # Test for a target whose commands are defined twice.  This generates a
 # warning, not an error, so ensure that the correct commands are kept.
 #
 # Also ensure that the diagnostics mention the correct file in case of
-# included files.  This particular case had been broken in parse.c 1.231 from
-# 2018-12-22.
+# included files.  Since parse.c 1.231 from 2018-12-22 and before parse.c
+# 1.653 from 2022-01-20, the wrong filename had been printed if the file of
+# the first commands section was in a file that was included by its relative
+# path.
 
-# expect: make: "dep-duplicate.inc" line 15: warning: using previous script for "all" defined here
-# FIXME: The file "dep-duplicate.inc" has no line 15.
+# expect: make: "dep-duplicate.inc" line 3: warning: using previous script for "all" defined here
+# FIXME: The file "dep-duplicate.inc" has no line 3.
 
-# expect: first
 all: .PHONY
-	@echo first
+	@exec > dep-duplicate.main; \
+	echo '# empty line 1'; \
+	echo '# empty line 2'; \
+	echo 'all:; @echo main-output'; \
+	echo '.include "dep-duplicate.inc"'
 
-_!=	echo 'all:;echo second' > dep-duplicate.inc
-.include "${.CURDIR}/dep-duplicate.inc"
+	@exec > dep-duplicate.inc; \
+	echo 'all:; @echo inc-output'
 
-.END:
+	# The main file must be specified using a relative path, just like the
+	# default 'makefile' or 'Makefile', to produce the same result when
+	# run via ATF or 'make test'.
+	@${MAKE} -r -f dep-duplicate.main
+
+	@rm -f dep-duplicate.main
 	@rm -f dep-duplicate.inc



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

2022-01-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jan 20 19:16:25 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: dep-duplicate.exp dep-duplicate.mk

Log Message:
tests/make: refine test for wrong diagnostic line

To trigger the faulty code path, the file where the targets gets its
first command must be included via its relative path.  That was the case
when running 'cd usr.bin/make && make test' but not when running the
tests via ATF.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dep-duplicate.exp \
src/usr.bin/make/unit-tests/dep-duplicate.mk

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



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

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:46:06 UTC 2022

Modified Files:
src/external/gpl2/xcvs/dist/src: main.c

Log Message:
fix bug in the original code I copied from to scan_ffs


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/xcvs/dist/src/main.c

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



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

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:46:06 UTC 2022

Modified Files:
src/external/gpl2/xcvs/dist/src: main.c

Log Message:
fix bug in the original code I copied from to scan_ffs


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/xcvs/dist/src/main.c

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

Modified files:

Index: src/external/gpl2/xcvs/dist/src/main.c
diff -u src/external/gpl2/xcvs/dist/src/main.c:1.7 src/external/gpl2/xcvs/dist/src/main.c:1.8
--- src/external/gpl2/xcvs/dist/src/main.c:1.7	Tue Aug 21 11:37:33 2018
+++ src/external/gpl2/xcvs/dist/src/main.c	Thu Jan 20 09:46:06 2022
@@ -17,7 +17,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: main.c,v 1.7 2018/08/21 15:37:33 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.8 2022/01/20 14:46:06 christos Exp $");
 
 #include "cvs.h"
 
@@ -509,7 +509,7 @@ show_status (int n)
 	static int ttyfd = -2;
 
 	if (ttyfd == -2)
-		ttyfd = open(_PATH_TTY, O_RDWR, O_CLOEXEC);
+		ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
 
 	if (ttyfd == -1)
 		return;



CVS commit: src/sbin/scan_ffs

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:45:14 UTC 2022

Modified Files:
src/sbin/scan_ffs: scan_ffs.c

Log Message:
O_CLOEXEC is not a mode :-)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/scan_ffs/scan_ffs.c

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

Modified files:

Index: src/sbin/scan_ffs/scan_ffs.c
diff -u src/sbin/scan_ffs/scan_ffs.c:1.34 src/sbin/scan_ffs/scan_ffs.c:1.35
--- src/sbin/scan_ffs/scan_ffs.c:1.34	Thu Jan 20 09:44:19 2022
+++ src/sbin/scan_ffs/scan_ffs.c	Thu Jan 20 09:45:14 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: scan_ffs.c,v 1.34 2022/01/20 14:44:19 christos Exp $ */
+/* $NetBSD: scan_ffs.c,v 1.35 2022/01/20 14:45:14 christos Exp $ */
 
 /*
  * Copyright (c) 2005-2007 Juan Romero Pardines
@@ -33,7 +33,7 @@
  
 #include 
 #ifndef lint
-__RCSID("$NetBSD: scan_ffs.c,v 1.34 2022/01/20 14:44:19 christos Exp $");
+__RCSID("$NetBSD: scan_ffs.c,v 1.35 2022/01/20 14:45:14 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -392,7 +392,7 @@ show_status(uintmax_t beg, uintmax_t tot
 	int n;
 
 	if (ttyfd == -2)
-		ttyfd = open(_PATH_TTY, O_RDWR, O_CLOEXEC);
+		ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC);
 
 	if (ttyfd == -1)
 		return;



CVS commit: src/sbin/scan_ffs

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:45:14 UTC 2022

Modified Files:
src/sbin/scan_ffs: scan_ffs.c

Log Message:
O_CLOEXEC is not a mode :-)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/scan_ffs/scan_ffs.c

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



CVS commit: src/sbin/scan_ffs

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:44:19 UTC 2022

Modified Files:
src/sbin/scan_ffs: scan_ffs.c

Log Message:
- use /dev/tty instead of stderr for SIGINFO messages
- use uintmax_t instead of ull
- print fractional percentage to show that we are making progress on large
  disks.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sbin/scan_ffs/scan_ffs.c

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

Modified files:

Index: src/sbin/scan_ffs/scan_ffs.c
diff -u src/sbin/scan_ffs/scan_ffs.c:1.33 src/sbin/scan_ffs/scan_ffs.c:1.34
--- src/sbin/scan_ffs/scan_ffs.c:1.33	Tue Jan 18 20:40:05 2022
+++ src/sbin/scan_ffs/scan_ffs.c	Thu Jan 20 09:44:19 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: scan_ffs.c,v 1.33 2022/01/19 01:40:05 mrg Exp $ */
+/* $NetBSD: scan_ffs.c,v 1.34 2022/01/20 14:44:19 christos Exp $ */
 
 /*
  * Copyright (c) 2005-2007 Juan Romero Pardines
@@ -33,7 +33,7 @@
  
 #include 
 #ifndef lint
-__RCSID("$NetBSD: scan_ffs.c,v 1.33 2022/01/19 01:40:05 mrg Exp $");
+__RCSID("$NetBSD: scan_ffs.c,v 1.34 2022/01/20 14:44:19 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -57,6 +57,7 @@ __RCSID("$NetBSD: scan_ffs.c,v 1.33 2022
 #include 
 #include 
 #include 
+#include 
 
 #define BLK_CNT		(blk + (n / 512))
 
@@ -381,6 +382,29 @@ lfs_checkmagic(struct sblockinfo *sbinfo
 	}
 }
 
+static void
+show_status(uintmax_t beg, uintmax_t total)
+{
+	static int ttyfd = -2;
+	char buf[2048];
+	const uintmax_t done = blk - beg;
+	const double pcent = (100.0 * done) / total;
+	int n;
+
+	if (ttyfd == -2)
+		ttyfd = open(_PATH_TTY, O_RDWR, O_CLOEXEC);
+
+	if (ttyfd == -1)
+		return;
+
+	n = snprintf(buf, sizeof(buf), "%s: done %ju of %ju blocks (%3.2f%%)\n", 
+	getprogname(), done, total, pcent);
+
+	if (n <= 0)
+		return;
+	write(ttyfd, buf, (size_t)n);
+}
+
 static int
 scan_disk(int fd, daddr_t beg, daddr_t end, int fflags)
 {
@@ -401,12 +425,8 @@ scan_disk(int fd, daddr_t beg, daddr_t e
 	const daddr_t total = end - beg;
 	for (blk = beg; blk <= end; blk += SBPASS) {
 		if (print_info) {
-			const daddr_t done = blk - beg;
-			const int pcent = (int)((100.0 * done) / total);
+			show_status(beg, total);
 
-			fprintf(stderr, "%s: done %llu of %llu blocks (%d%%)\n", 
-getprogname(), (unsigned long long)done,
-(unsigned long long)total, pcent);
 			print_info = 0;
 		}
 		if (pread(fd, buf, sizeof(buf), blk * 512) == -1) {



CVS commit: src/sbin/scan_ffs

2022-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 20 14:44:19 UTC 2022

Modified Files:
src/sbin/scan_ffs: scan_ffs.c

Log Message:
- use /dev/tty instead of stderr for SIGINFO messages
- use uintmax_t instead of ull
- print fractional percentage to show that we are making progress on large
  disks.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sbin/scan_ffs/scan_ffs.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/doc

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:46:24 UTC 2022

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

Log Message:
Tickets #1399 and #1406


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.66 -r1.1.2.67 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.66 src/doc/CHANGES-9.3:1.1.2.67
--- src/doc/CHANGES-9.3:1.1.2.66	Tue Jan 18 20:03:03 2022
+++ src/doc/CHANGES-9.3	Thu Jan 20 11:46:24 2022
@@ -1,4 +1,4 @@
-29~# $NetBSD: CHANGES-9.3,v 1.1.2.66 2022/01/18 20:03:03 snj Exp $
+29~# $NetBSD: CHANGES-9.3,v 1.1.2.67 2022/01/20 11:46:24 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -1184,3 +1184,18 @@ sys/dev/usb/usb_quirks.c			1.102
 	Ignore new APC UPS devices when matching uhid devices.
 	[martin, ticket #1405]
 
+sys/dev/acpi/acpi_display.c			1.21
+
+	acpiout(4): Work around firmware that doesn't like some brightnesses.
+	[riastradh, ticket #1399]
+
+usr.sbin/sysinst/msg.mi.de			1.35
+usr.sbin/sysinst/msg.mi.en			1.37
+usr.sbin/sysinst/msg.mi.es			1.31
+usr.sbin/sysinst/msg.mi.fr			1.36
+usr.sbin/sysinst/msg.mi.pl			1.37
+usr.sbin/sysinst/net.c1.37-1.40
+
+	sysinst(8): Add support for connecting to Wi-Fi networks.
+	[nia, ticket #1406]
+



CVS commit: [netbsd-9] src/doc

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:46:24 UTC 2022

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

Log Message:
Tickets #1399 and #1406


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.66 -r1.1.2.67 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/usr.sbin/sysinst

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:45:28 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl net.c

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

usr.sbin/sysinst/net.c: revision 1.40
usr.sbin/sysinst/msg.mi.pl: revision 1.37
usr.sbin/sysinst/msg.mi.fr: revision 1.36
usr.sbin/sysinst/msg.mi.de: revision 1.35
usr.sbin/sysinst/msg.mi.en: revision 1.37
usr.sbin/sysinst/net.c: revision 1.37
usr.sbin/sysinst/net.c: revision 1.38
usr.sbin/sysinst/msg.mi.es: revision 1.31
usr.sbin/sysinst/net.c: revision 1.39

sysinst(8): Add initial support for connecting to Wi-Fi networks
by spawning wpa_supplicant.
Reviewed by martin.

sysinst(8): Avoid asking Wi-Fi questions about non-Wi-Fi devices.

sysinst(8): Add a "data" argument to do_ifreq that is set after the
ifr struct is zeroed.

This allows us to simplify the code by not having 2x socket creation
code for checking whether interfaces are wireless.
sysinst(8): use scan_ssid=1 so hidden wifi networks can be used


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.9 -r1.13.2.10 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.10 -r1.19.2.11 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.9 -r1.14.2.10 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.10 -r1.17.2.11 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.10 -r1.20.2.11 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33.2.2 -r1.33.2.3 src/usr.sbin/sysinst/net.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.sbin/sysinst

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:45:28 UTC 2022

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl net.c

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

usr.sbin/sysinst/net.c: revision 1.40
usr.sbin/sysinst/msg.mi.pl: revision 1.37
usr.sbin/sysinst/msg.mi.fr: revision 1.36
usr.sbin/sysinst/msg.mi.de: revision 1.35
usr.sbin/sysinst/msg.mi.en: revision 1.37
usr.sbin/sysinst/net.c: revision 1.37
usr.sbin/sysinst/net.c: revision 1.38
usr.sbin/sysinst/msg.mi.es: revision 1.31
usr.sbin/sysinst/net.c: revision 1.39

sysinst(8): Add initial support for connecting to Wi-Fi networks
by spawning wpa_supplicant.
Reviewed by martin.

sysinst(8): Avoid asking Wi-Fi questions about non-Wi-Fi devices.

sysinst(8): Add a "data" argument to do_ifreq that is set after the
ifr struct is zeroed.

This allows us to simplify the code by not having 2x socket creation
code for checking whether interfaces are wireless.
sysinst(8): use scan_ssid=1 so hidden wifi networks can be used


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.9 -r1.13.2.10 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.10 -r1.19.2.11 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.9 -r1.14.2.10 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.10 -r1.17.2.11 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.10 -r1.20.2.11 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.33.2.2 -r1.33.2.3 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.13.2.9 src/usr.sbin/sysinst/msg.mi.de:1.13.2.10
--- src/usr.sbin/sysinst/msg.mi.de:1.13.2.9	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.de	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.13.2.9 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.13.2.10 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -639,6 +639,12 @@ message net_defroute
 message net_media
 {Art der Netzwerkverbindung}
 
+message net_ssid
+{WLAN-SSID?}
+
+message net_passphrase
+{WLAN-Passwort?}
+
 message netok
 {Nachfolgend sehen Sie die aktuellen Netzwerkeinstellungen.
 

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.19.2.10 src/usr.sbin/sysinst/msg.mi.en:1.19.2.11
--- src/usr.sbin/sysinst/msg.mi.en:1.19.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.en	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.19.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.19.2.11 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -616,6 +616,12 @@ message net_defroute
 message net_media
 {Network media type}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {The following are the values you entered.
 

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.14.2.9 src/usr.sbin/sysinst/msg.mi.es:1.14.2.10
--- src/usr.sbin/sysinst/msg.mi.es:1.14.2.9	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.es	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.14.2.9 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.14.2.10 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -632,6 +632,12 @@ message net_defroute
 message net_media
 {Tipo de medio de la red}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {Ha introducido los siguientes valores.
 

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.17.2.10 src/usr.sbin/sysinst/msg.mi.fr:1.17.2.11
--- src/usr.sbin/sysinst/msg.mi.fr:1.17.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.fr	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.17.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.17.2.11 2022/01/20 11:45:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -626,6 +626,12 @@ message net_defroute
 message net_media
 {Type de réseau (média)}
 
+message net_ssid
+{Wi-Fi SSID?}
+
+message net_passphrase
+{Wi-Fi passphrase?}
+
 message netok
 {Vous avez spécifié les valeurs suivantes :
 

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.20.2.10 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.11
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.10	Thu Nov  5 08:10:21 2020
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu Jan 20 11:45:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.20.2.10 2020/11/05 08:10:21 sborrill Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.20.2.11 2022/01/20 

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

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:42:22 UTC 2022

Modified Files:
src/sys/dev/acpi [netbsd-9]: acpi_display.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1399):

sys/dev/acpi/acpi_display.c: revision 1.21

acpiout(4): Work around firmware that doesn't like some brightnesses.

Instead of just asking for cur - 5 or cur + 5, repeatedly ask for
that increment, check whether we actually made progress in that
direction, and if not keep going with another increment, until we hit
the bounds of brightness levels.

I can't find anything in the ACPI spec about this, but my laptop
seems to have trouble with certain levels: 15, 75, 85, 95.  It goes
in all other increments of 5 from 5 to 100, just not those ones --
acts as if the change just never happened, so with the old logic the
brightness up/down would get stuck unable to move in either
direction.

This should have no impact on machines where the first increment
actually takes.


To generate a diff of this commit:
cvs rdiff -u -r1.16.16.2 -r1.16.16.3 src/sys/dev/acpi/acpi_display.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/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.16.16.2 src/sys/dev/acpi/acpi_display.c:1.16.16.3
--- src/sys/dev/acpi/acpi_display.c:1.16.16.2	Tue Jun 30 18:45:18 2020
+++ src/sys/dev/acpi/acpi_display.c	Thu Jan 20 11:42:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.16.16.2 2020/06/30 18:45:18 martin Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.16.16.3 2022/01/20 11:42:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.16.16.2 2020/06/30 18:45:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.16.16.3 2022/01/20 11:42:22 martin Exp $");
 
 #include 
 #include 
@@ -1010,7 +1010,8 @@ acpidisp_out_increase_brightness_callbac
 {
 	struct acpidisp_out_softc *osc = arg;
 	struct acpidisp_brctl *bc = osc->sc_brctl;
-	uint8_t lo, up;
+	uint8_t max, lo, up;
+	int cur;
 
 	if (bc == NULL) {
 		/* Fallback to pmf(9). */
@@ -1019,16 +1020,21 @@ acpidisp_out_increase_brightness_callbac
 	}
 
 	mutex_enter(osc->sc_mtx);
-
-	(void)acpidisp_get_brightness(osc, >bc_current);
-
-	acpidisp_array_search(bc->bc_level, bc->bc_level_count,
-	bc->bc_current + ACPI_DISP_BRCTL_STEP, , );
-
-	bc->bc_current = up;
-	(void)acpidisp_set_brightness(osc, bc->bc_current);
-
-	mutex_exit(osc->sc_mtx);
+	max = bc->bc_level[bc->bc_level_count - 1];
+	if (acpidisp_get_brightness(osc, >bc_current))
+		goto out;
+	for (cur = bc->bc_current; (cur += ACPI_DISP_BRCTL_STEP) <= max;) {
+		acpidisp_array_search(bc->bc_level, bc->bc_level_count, cur,
+		, );
+		bc->bc_current = up;
+		if (acpidisp_set_brightness(osc, bc->bc_current))
+			goto out;
+		if (acpidisp_get_brightness(osc, >bc_current))
+			goto out;
+		if (bc->bc_current >= cur)
+			break;
+	}
+out:	mutex_exit(osc->sc_mtx);
 }
 
 static void
@@ -1036,7 +1042,8 @@ acpidisp_out_decrease_brightness_callbac
 {
 	struct acpidisp_out_softc *osc = arg;
 	struct acpidisp_brctl *bc = osc->sc_brctl;
-	uint8_t lo, up;
+	uint8_t min, lo, up;
+	int cur;
 
 	if (bc == NULL) {
 		/* Fallback to pmf(9). */
@@ -1045,16 +1052,21 @@ acpidisp_out_decrease_brightness_callbac
 	}
 
 	mutex_enter(osc->sc_mtx);
-
-	(void)acpidisp_get_brightness(osc, >bc_current);
-
-	acpidisp_array_search(bc->bc_level, bc->bc_level_count,
-	bc->bc_current - ACPI_DISP_BRCTL_STEP, , );
-
-	bc->bc_current = lo;
-	(void)acpidisp_set_brightness(osc, bc->bc_current);
-
-	mutex_exit(osc->sc_mtx);
+	min = bc->bc_level[0];
+	if (acpidisp_get_brightness(osc, >bc_current))
+		goto out;
+	for (cur = bc->bc_current; (cur -= ACPI_DISP_BRCTL_STEP) >= min;) {
+		acpidisp_array_search(bc->bc_level, bc->bc_level_count, cur,
+		, );
+		bc->bc_current = lo;
+		if (acpidisp_set_brightness(osc, bc->bc_current))
+			goto out;
+		if (acpidisp_get_brightness(osc, >bc_current))
+			goto out;
+		if (bc->bc_current <= cur)
+			break;
+	}
+out:	mutex_exit(osc->sc_mtx);
 }
 
 static void



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

2022-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 20 11:42:22 UTC 2022

Modified Files:
src/sys/dev/acpi [netbsd-9]: acpi_display.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1399):

sys/dev/acpi/acpi_display.c: revision 1.21

acpiout(4): Work around firmware that doesn't like some brightnesses.

Instead of just asking for cur - 5 or cur + 5, repeatedly ask for
that increment, check whether we actually made progress in that
direction, and if not keep going with another increment, until we hit
the bounds of brightness levels.

I can't find anything in the ACPI spec about this, but my laptop
seems to have trouble with certain levels: 15, 75, 85, 95.  It goes
in all other increments of 5 from 5 to 100, just not those ones --
acts as if the change just never happened, so with the old logic the
brightness up/down would get stuck unable to move in either
direction.

This should have no impact on machines where the first increment
actually takes.


To generate a diff of this commit:
cvs rdiff -u -r1.16.16.2 -r1.16.16.3 src/sys/dev/acpi/acpi_display.c

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