CVS commit: src/sys/lib/libsa

2020-12-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Dec 19 07:19:30 UTC 2020

Modified Files:
src/sys/lib/libsa: ufs.c

Log Message:
ufs_open(): Check fs->lfs_version ifdef LIBSA_*L*FS, not LIBSA_*F*FS.

This was harmless for FFS variants, that define LIBSA_FFSv[12], not LIBSA_FFS.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/lib/libsa/ufs.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/lib/libsa/ufs.c
diff -u src/sys/lib/libsa/ufs.c:1.76 src/sys/lib/libsa/ufs.c:1.77
--- src/sys/lib/libsa/ufs.c:1.76	Tue Apr  2 22:25:10 2019
+++ src/sys/lib/libsa/ufs.c	Sat Dec 19 07:19:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs.c,v 1.76 2019/04/02 22:25:10 christos Exp $	*/
+/*	$NetBSD: ufs.c,v 1.77 2020/12/19 07:19:30 rin Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -582,7 +582,7 @@ ufs_open(const char *path, struct open_f
 		if (rc)
 			goto out;
 		if (buf_size != SBLOCKSIZE ||
-#ifdef LIBSA_FFS
+#ifdef LIBSA_LFS
 		fs->lfs_version != REQUIRED_LFS_VERSION ||
 #endif
 		fs->fs_magic != FS_MAGIC) {



CVS commit: src/sys/dev

2020-12-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 01:18:59 UTC 2020

Modified Files:
src/sys/dev: midi.c sequencer.c
src/sys/dev/apm: apm.c
src/sys/dev/audio: audio.c
src/sys/dev/hpc/apm: apmdev.c
src/sys/dev/ir: irframe_tty.c

Log Message:
Use sel{record,remove}_knote().


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/dev/midi.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/sequencer.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/apm/apm.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/hpc/apm/apmdev.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/ir/irframe_tty.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/midi.c
diff -u src/sys/dev/midi.c:1.90 src/sys/dev/midi.c:1.91
--- src/sys/dev/midi.c:1.90	Sat May 23 23:42:42 2020
+++ src/sys/dev/midi.c	Sat Dec 19 01:18:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.90 2020/05/23 23:42:42 ad Exp $	*/
+/*	$NetBSD: midi.c,v 1.91 2020/12/19 01:18:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.90 2020/05/23 23:42:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.91 2020/12/19 01:18:58 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "midi.h"
@@ -1743,7 +1743,7 @@ filt_midirdetach(struct knote *kn)
 	struct midi_softc *sc = kn->kn_hook;
 
 	mutex_enter(sc->lock);
-	SLIST_REMOVE(&sc->rsel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(&sc->rsel, kn);
 	mutex_exit(sc->lock);
 }
 
@@ -1776,7 +1776,7 @@ filt_midiwdetach(struct knote *kn)
 	struct midi_softc *sc = kn->kn_hook;
 
 	mutex_enter(sc->lock);
-	SLIST_REMOVE(&sc->wsel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(&sc->wsel, kn);
 	mutex_exit(sc->lock);
 }
 
@@ -1823,36 +1823,37 @@ midikqfilter(dev_t dev, struct knote *kn
 {
 	struct midi_softc *sc =
 	device_lookup_private(&midi_cd, MIDIUNIT(dev));
-	struct klist *klist;
+	struct selinfo *sip;
+	int error = 0;
 
-	mutex_exit(sc->lock);
-	sc->refcnt++;
 	mutex_enter(sc->lock);
+	sc->refcnt++;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = &sc->rsel.sel_klist;
+		sip = &sc->rsel;
 		kn->kn_fop = &midiread_filtops;
 		break;
 
 	case EVFILT_WRITE:
-		klist = &sc->wsel.sel_klist;
+		sip = &sc->wsel;
 		kn->kn_fop = &midiwrite_filtops;
 		break;
 
 	default:
-		return (EINVAL);
+		error = EINVAL;
+		goto out;
 	}
 
 	kn->kn_hook = sc;
 
-	mutex_enter(sc->lock);
-	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+	selrecord_knote(sip, kn);
+ out:
 	if (--sc->refcnt < 0)
 		cv_broadcast(&sc->detach_cv);
 	mutex_exit(sc->lock);
 
-	return (0);
+	return (error);
 }
 
 void

Index: src/sys/dev/sequencer.c
diff -u src/sys/dev/sequencer.c:1.72 src/sys/dev/sequencer.c:1.73
--- src/sys/dev/sequencer.c:1.72	Sat May 23 23:42:42 2020
+++ src/sys/dev/sequencer.c	Sat Dec 19 01:18:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.72 2020/05/23 23:42:42 ad Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.73 2020/12/19 01:18:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.72 2020/05/23 23:42:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.73 2020/12/19 01:18:58 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "sequencer.h"
@@ -901,7 +901,7 @@ filt_sequencerrdetach(struct knote *kn)
 	struct sequencer_softc *sc = kn->kn_hook;
 
 	mutex_enter(&sc->lock);
-	SLIST_REMOVE(&sc->rsel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(&sc->rsel, kn);
 	mutex_exit(&sc->lock);
 }
 
@@ -939,7 +939,7 @@ filt_sequencerwdetach(struct knote *kn)
 	struct sequencer_softc *sc = kn->kn_hook;
 
 	mutex_enter(&sc->lock);
-	SLIST_REMOVE(&sc->wsel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(&sc->wsel, kn);
 	mutex_exit(&sc->lock);
 }
 
@@ -975,18 +975,18 @@ static int
 sequencerkqfilter(dev_t dev, struct knote *kn)
 {
 	struct sequencer_softc *sc;
-	struct klist *klist;
+	struct selinfo *sip;
 	if ((sc = sequencerget(SEQUENCERUNIT(dev))) == NULL)
 		return ENXIO;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = &sc->rsel.sel_klist;
+		sip = &sc->rsel;
 		kn->kn_fop = &sequencerread_filtops;
 		break;
 
 	case EVFILT_WRITE:
-		klist = &sc->wsel.sel_klist;
+		sip = &sc->wsel;
 		kn->kn_fop = &sequencerwrite_filtops;
 		break;
 
@@ -997,7 +997,7 @@ sequencerkqfilter(dev_t dev, struct knot
 	kn->kn_hook = sc;
 
 	mutex_enter(&sc->lock);
-	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+	selrecord_knote(sip, kn);
 	mutex_exit(&sc->lock);
 
 	return (0);

Index: src/sys/dev/apm/apm.c
diff -u src/sys/dev/apm/apm.c:1.33 src/sys/dev/apm/apm.c:1.34
--- src/sys/dev/apm/apm.c:1.33	Sat Oct 28 04:53:54 2017
+++ src/sys/dev/apm/apm.c	Sat Dec 19 01:18:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: apm.c,v 1.33 2017/10/28 04:53:54 riastradh Exp $ */
+

CVS commit: src/sys/dev

2020-12-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 01:12:21 UTC 2020

Modified Files:
src/sys/dev: bio.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/bio.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/bio.c
diff -u src/sys/dev/bio.c:1.16 src/sys/dev/bio.c:1.17
--- src/sys/dev/bio.c:1.16	Sun Nov 10 21:16:34 2019
+++ src/sys/dev/bio.c	Sat Dec 19 01:12:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bio.c,v 1.16 2019/11/10 21:16:34 chs Exp $ */
+/*	$NetBSD: bio.c,v 1.17 2020/12/19 01:12:21 thorpej Exp $ */
 /*	$OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $	*/
 
 /*
@@ -28,7 +28,7 @@
 /* A device controller ioctl tunnelling device.  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bio.c,v 1.16 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bio.c,v 1.17 2020/12/19 01:12:21 thorpej Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -37,7 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: bio.c,v 1.16
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -208,7 +208,7 @@ bio_register(device_t dev, int (*ioctl)(
 	if (!bio_lock_initialized)
 		bio_initialize();
 
-	bm = malloc(sizeof(*bm), M_DEVBUF, M_WAITOK|M_ZERO);
+	bm = kmem_zalloc(sizeof(*bm), KM_SLEEP);
 	bm->bm_dev = dev;
 	bm->bm_ioctl = ioctl;
 	mutex_enter(&bio_lock);
@@ -228,7 +228,7 @@ bio_unregister(device_t dev)
 
 		if (dev == bm->bm_dev) {
 			LIST_REMOVE(bm, bm_link);
-			free(bm, M_DEVBUF);
+			kmem_free(bm, sizeof(*bm));
 		}
 	}
 	mutex_exit(&bio_lock);



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Dec 19 00:27:34 UTC 2020

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

Log Message:
make(1): clean up ParseRawLine


To generate a diff of this commit:
cvs rdiff -u -r1.489 -r1.490 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.489 src/usr.bin/make/parse.c:1.490
--- src/usr.bin/make/parse.c:1.489	Sat Dec 19 00:20:57 2020
+++ src/usr.bin/make/parse.c	Sat Dec 19 00:27:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.489 2020/12/19 00:20:57 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.490 2020/12/19 00:27:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.489 2020/12/19 00:20:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.490 2020/12/19 00:27:34 rillig Exp $");
 
 /* types and constants */
 
@@ -2661,17 +2661,19 @@ ParseEOF(void)
  * Do not unescape "\#", that's done by UnescapeBackslash.
  */
 static Boolean
-ParseRawLine(char **inout_line, char **out_ptr, char **out_line_end,
+ParseRawLine(char **out_line, char **out_line_end,
 	  char **out_escaped, char **out_comment, char *inout_ch,
 	  IFile *const cf)
 {
-	char *line = *inout_line;
+	char *line = cf->buf_ptr;
 	char *ptr = line;
 	char *line_end = line;
 	char *escaped = NULL;
 	char *comment = NULL;
 	char ch = *inout_ch;
 
+	cf->lineno++;
+
 	for (;;) {
 		if (ptr == cf->buf_end) {
 			/* end of buffer */
@@ -2720,8 +2722,8 @@ ParseRawLine(char **inout_line, char **o
 			line_end = ptr;
 	}
 
-	*inout_line = line;
-	*out_ptr = ptr;
+	*out_line = line;
+	cf->buf_ptr = ptr;
 	*out_line_end = line_end;
 	*out_escaped = escaped;
 	*out_comment = comment;
@@ -2795,7 +2797,6 @@ static char *
 ParseGetLine(GetLineMode mode)
 {
 	IFile *cf = CurFile();
-	char *ptr;
 	char ch;
 	char *line;
 	char *line_end;
@@ -2804,15 +2805,9 @@ ParseGetLine(GetLineMode mode)
 
 	/* Loop through blank lines and comment lines */
 	for (;;) {
-		cf->lineno++;
-		line = cf->buf_ptr;
-		if (!ParseRawLine(&line, &ptr, &line_end, &escaped, &comment,
-		&ch, cf))
+		if (!ParseRawLine(&line, &line_end, &escaped, &comment, &ch, cf))
 			return NULL;
 
-		/* Save next 'to be processed' location */
-		cf->buf_ptr = ptr;
-
 		/* Check we have a non-comment, non-blank line */
 		if (line_end == line || comment == line) {
 			if (ch == '\0')



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Dec 19 00:20:57 UTC 2020

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

Log Message:
make(1): extract ParseRawLine from ParseGetLine


To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 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.488 src/usr.bin/make/parse.c:1.489
--- src/usr.bin/make/parse.c:1.488	Sat Dec 19 00:02:34 2020
+++ src/usr.bin/make/parse.c	Sat Dec 19 00:20:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.488 2020/12/19 00:02:34 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.489 2020/12/19 00:20:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.488 2020/12/19 00:02:34 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.489 2020/12/19 00:20:57 rillig Exp $");
 
 /* types and constants */
 
@@ -2656,6 +2656,79 @@ ParseEOF(void)
 	return TRUE;
 }
 
+/*
+ * Parse a line, joining physical lines that end with backslash-newline.
+ * Do not unescape "\#", that's done by UnescapeBackslash.
+ */
+static Boolean
+ParseRawLine(char **inout_line, char **out_ptr, char **out_line_end,
+	  char **out_escaped, char **out_comment, char *inout_ch,
+	  IFile *const cf)
+{
+	char *line = *inout_line;
+	char *ptr = line;
+	char *line_end = line;
+	char *escaped = NULL;
+	char *comment = NULL;
+	char ch = *inout_ch;
+
+	for (;;) {
+		if (ptr == cf->buf_end) {
+			/* end of buffer */
+			ch = '\0';
+			break;
+		}
+
+		ch = *ptr;
+		if (ch == '\0' ||
+		(ch == '\\' && ptr + 1 < cf->buf_end &&
+		 ptr[1] == '\0')) {
+			Parse_Error(PARSE_FATAL,
+			"Zero byte read from file");
+			return FALSE;
+		}
+
+		/*
+		 * Don't treat next character after '\' as special,
+		 * remember first one.
+		 */
+		if (ch == '\\') {
+			if (escaped == NULL)
+escaped = ptr;
+			if (ptr[1] == '\n')
+cf->lineno++;
+			ptr += 2;
+			line_end = ptr;
+			continue;
+		}
+
+		/*
+		 * Remember the first '#' for comment stripping,
+		 * unless the previous char was '[', as in the
+		 * modifier ':[#]'.
+		 */
+		if (ch == '#' && comment == NULL &&
+		!(ptr > line && ptr[-1] == '['))
+			comment = line_end;
+
+		ptr++;
+		if (ch == '\n')
+			break;
+
+		/* We are not interested in trailing whitespace. */
+		if (!ch_isspace(ch))
+			line_end = ptr;
+	}
+
+	*inout_line = line;
+	*out_ptr = ptr;
+	*out_line_end = line_end;
+	*out_escaped = escaped;
+	*out_comment = comment;
+	*inout_ch = ch;
+	return TRUE;
+}
+
 static void
 UnescapeBackslash(char *escaped, char *const line)
 {
@@ -2733,57 +2806,9 @@ ParseGetLine(GetLineMode mode)
 	for (;;) {
 		cf->lineno++;
 		line = cf->buf_ptr;
-		ptr = line;
-		line_end = line;
-		escaped = NULL;
-		comment = NULL;
-		for (;;) {
-			if (ptr == cf->buf_end) {
-/* end of buffer */
-ch = '\0';
-break;
-			}
-
-			ch = *ptr;
-			if (ch == '\0' ||
-			(ch == '\\' && ptr + 1 < cf->buf_end &&
-			 ptr[1] == '\0')) {
-Parse_Error(PARSE_FATAL,
-"Zero byte read from file");
-return NULL;
-			}
-
-			/*
-			 * Don't treat next character after '\' as special,
-			 * remember first one.
-			 */
-			if (ch == '\\') {
-if (escaped == NULL)
-	escaped = ptr;
-if (ptr[1] == '\n')
-	cf->lineno++;
-ptr += 2;
-line_end = ptr;
-continue;
-			}
-
-			/*
-			 * Remember the first '#' for comment stripping,
-			 * unless the previous char was '[', as in the
-			 * modifier ':[#]'.
-			 */
-			if (ch == '#' && comment == NULL &&
-			!(ptr > line && ptr[-1] == '['))
-comment = line_end;
-
-			ptr++;
-			if (ch == '\n')
-break;
-
-			/* We are not interested in trailing whitespace. */
-			if (!ch_isspace(ch))
-line_end = ptr;
-		}
+		if (!ParseRawLine(&line, &ptr, &line_end, &escaped, &comment,
+		&ch, cf))
+			return NULL;
 
 		/* Save next 'to be processed' location */
 		cf->buf_ptr = ptr;



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Dec 19 00:02:35 UTC 2020

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

Log Message:
make(1): clean up another local variable in ParseGetLine


To generate a diff of this commit:
cvs rdiff -u -r1.487 -r1.488 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.487 src/usr.bin/make/parse.c:1.488
--- src/usr.bin/make/parse.c:1.487	Fri Dec 18 23:18:08 2020
+++ src/usr.bin/make/parse.c	Sat Dec 19 00:02:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.487 2020/12/18 23:18:08 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.488 2020/12/19 00:02:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.487 2020/12/18 23:18:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.488 2020/12/19 00:02:34 rillig Exp $");
 
 /* types and constants */
 
@@ -2657,7 +2657,7 @@ ParseEOF(void)
 }
 
 static void
-UnescapeBackslash(char **out_tp, char *escaped, char *const line)
+UnescapeBackslash(char *escaped, char *const line)
 {
 	char *tp, *ptr;
 
@@ -2710,8 +2710,6 @@ UnescapeBackslash(char **out_tp, char *e
 	while (tp > escaped && ch_isspace(tp[-1]))
 		tp--;
 	*tp = '\0';
-
-	*out_tp = tp;
 }
 
 typedef enum GetLineMode {
@@ -2730,7 +2728,6 @@ ParseGetLine(GetLineMode mode)
 	char *line_end;
 	char *escaped;
 	char *comment;
-	char *tp;
 
 	/* Loop through blank lines and comment lines */
 	for (;;) {
@@ -2831,7 +2828,7 @@ ParseGetLine(GetLineMode mode)
 		return line;
 
 	/* Remove escapes from '\n' and '#' */
-	UnescapeBackslash(&tp, escaped, line);
+	UnescapeBackslash(escaped, line);
 
 	return line;
 }



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 23:18:08 UTC 2020

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

Log Message:
make(1): clean up UnescapeBackslash


To generate a diff of this commit:
cvs rdiff -u -r1.486 -r1.487 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.486 src/usr.bin/make/parse.c:1.487
--- src/usr.bin/make/parse.c:1.486	Fri Dec 18 23:13:45 2020
+++ src/usr.bin/make/parse.c	Fri Dec 18 23:18:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.486 2020/12/18 23:13:45 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.487 2020/12/18 23:18:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.486 2020/12/18 23:13:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.487 2020/12/18 23:18:08 rillig Exp $");
 
 /* types and constants */
 
@@ -2657,10 +2657,9 @@ ParseEOF(void)
 }
 
 static void
-UnescapeBackslash(char **out_tp, char **inout_escaped,
-		  char *const line) {
+UnescapeBackslash(char **out_tp, char *escaped, char *const line)
+{
 	char *tp, *ptr;
-	char *escaped = *inout_escaped;
 
 	tp = ptr = escaped;
 	escaped = line;
@@ -2707,21 +2706,12 @@ UnescapeBackslash(char **out_tp, char **
 		*tp++ = ch;
 	}
 
-	*out_tp = tp;
-	*inout_escaped = escaped;
-}
-
-/* Delete any trailing spaces - eg from empty continuations */
-static void
-TrimRight(char **inout_tp, const char * const escaped)
-{
-	char *tp = *inout_tp;
-
+	/* Delete any trailing spaces - eg from empty continuations */
 	while (tp > escaped && ch_isspace(tp[-1]))
 		tp--;
 	*tp = '\0';
 
-	*inout_tp = tp;
+	*out_tp = tp;
 }
 
 typedef enum GetLineMode {
@@ -2841,9 +2831,7 @@ ParseGetLine(GetLineMode mode)
 		return line;
 
 	/* Remove escapes from '\n' and '#' */
-	UnescapeBackslash(&tp, &escaped, line);
-
-	TrimRight(&tp, escaped);
+	UnescapeBackslash(&tp, escaped, line);
 
 	return line;
 }



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 23:13:45 UTC 2020

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

Log Message:
make(1): remove unused parameter from UnescapeBackslash


To generate a diff of this commit:
cvs rdiff -u -r1.485 -r1.486 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.485 src/usr.bin/make/parse.c:1.486
--- src/usr.bin/make/parse.c:1.485	Fri Dec 18 19:02:37 2020
+++ src/usr.bin/make/parse.c	Fri Dec 18 23:13:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.485 2020/12/18 19:02:37 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.486 2020/12/18 23:13:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.485 2020/12/18 19:02:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.486 2020/12/18 23:13:45 rillig Exp $");
 
 /* types and constants */
 
@@ -2657,7 +2657,7 @@ ParseEOF(void)
 }
 
 static void
-UnescapeBackslash(char **out_tp, char **out_ptr, char **inout_escaped,
+UnescapeBackslash(char **out_tp, char **inout_escaped,
 		  char *const line) {
 	char *tp, *ptr;
 	char *escaped = *inout_escaped;
@@ -2708,7 +2708,6 @@ UnescapeBackslash(char **out_tp, char **
 	}
 
 	*out_tp = tp;
-	*out_ptr = ptr;
 	*inout_escaped = escaped;
 }
 
@@ -2842,7 +2841,7 @@ ParseGetLine(GetLineMode mode)
 		return line;
 
 	/* Remove escapes from '\n' and '#' */
-	UnescapeBackslash(&tp, &ptr, &escaped, line);
+	UnescapeBackslash(&tp, &escaped, line);
 
 	TrimRight(&tp, escaped);
 



CVS commit: src/external/bsd/pkg_install/dist

2020-12-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 18 20:07:40 UTC 2020

Removed Files:
src/external/bsd/pkg_install/dist: Makefile.in README config.guess
config.sub configure configure.ac diff install-sh tkpkg
src/external/bsd/pkg_install/dist/add: Makefile.in pkg_add.cat
src/external/bsd/pkg_install/dist/admin: Makefile.in audit-packages.cat
download-vulnerability-list.cat pkg_admin.cat
src/external/bsd/pkg_install/dist/create: Makefile.in pkg_create.cat
src/external/bsd/pkg_install/dist/delete: Makefile.in pkg_delete.cat
src/external/bsd/pkg_install/dist/info: Makefile.in pkg_info.cat
src/external/bsd/pkg_install/dist/lib: Makefile.in
pkg_install.conf.cat.in pkg_summary.cat pkgsrc.cat

Log Message:
Merge pkg_install-20201218


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/Makefile.in \
src/external/bsd/pkg_install/dist/README \
src/external/bsd/pkg_install/dist/config.guess \
src/external/bsd/pkg_install/dist/config.sub \
src/external/bsd/pkg_install/dist/configure \
src/external/bsd/pkg_install/dist/configure.ac \
src/external/bsd/pkg_install/dist/install-sh \
src/external/bsd/pkg_install/dist/tkpkg
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/pkg_install/dist/diff
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/add/Makefile.in
cvs rdiff -u -r1.4 -r0 src/external/bsd/pkg_install/dist/add/pkg_add.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/admin/Makefile.in \
src/external/bsd/pkg_install/dist/admin/audit-packages.cat \
src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.cat
cvs rdiff -u -r1.5 -r0 src/external/bsd/pkg_install/dist/admin/pkg_admin.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/create/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/create/pkg_create.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/delete/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/delete/pkg_delete.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/info/Makefile.in
cvs rdiff -u -r1.4 -r0 src/external/bsd/pkg_install/dist/info/pkg_info.cat
cvs rdiff -u -r1.3 -r0 src/external/bsd/pkg_install/dist/lib/Makefile.in
cvs rdiff -u -r1.4 -r0 \
src/external/bsd/pkg_install/dist/lib/pkg_install.conf.cat.in \
src/external/bsd/pkg_install/dist/lib/pkg_summary.cat \
src/external/bsd/pkg_install/dist/lib/pkgsrc.cat

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



CVS import: src/external/bsd/pkg_install/dist

2020-12-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 18 19:41:45 UTC 2020

Update of /cvsroot/src/external/bsd/pkg_install/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv6964

Log Message:
Import pkg_install-20201218

This time with the right style tag, and not adding unnecessary files (same
as previous imports).

Status:

Vendor Tag: PKGSRC
Release Tags:   pkg_install-20201218

U src/external/bsd/pkg_install/dist/add/add.h
U src/external/bsd/pkg_install/dist/add/main.c
U src/external/bsd/pkg_install/dist/add/perform.c
U src/external/bsd/pkg_install/dist/add/pkg_add.1
U src/external/bsd/pkg_install/dist/admin/admin.h
U src/external/bsd/pkg_install/dist/admin/audit-packages.8
U src/external/bsd/pkg_install/dist/admin/audit-packages.sh.in
U src/external/bsd/pkg_install/dist/admin/audit.c
U src/external/bsd/pkg_install/dist/admin/check.c
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.8
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.sh.in
U src/external/bsd/pkg_install/dist/admin/main.c
U src/external/bsd/pkg_install/dist/admin/pkg_admin.1
U src/external/bsd/pkg_install/dist/create/build.c
U src/external/bsd/pkg_install/dist/create/create.h
U src/external/bsd/pkg_install/dist/create/main.c
U src/external/bsd/pkg_install/dist/create/perform.c
U src/external/bsd/pkg_install/dist/create/pkg_create.1
U src/external/bsd/pkg_install/dist/create/pl.c
U src/external/bsd/pkg_install/dist/create/util.c
U src/external/bsd/pkg_install/dist/delete/pkg_delete.1
U src/external/bsd/pkg_install/dist/delete/pkg_delete.c
U src/external/bsd/pkg_install/dist/info/info.h
U src/external/bsd/pkg_install/dist/info/main.c
U src/external/bsd/pkg_install/dist/info/perform.c
U src/external/bsd/pkg_install/dist/info/pkg_info.1
U src/external/bsd/pkg_install/dist/info/show.c
U src/external/bsd/pkg_install/dist/lib/automatic.c
U src/external/bsd/pkg_install/dist/lib/config.h.in
U src/external/bsd/pkg_install/dist/lib/conflicts.c
U src/external/bsd/pkg_install/dist/lib/defs.h
U src/external/bsd/pkg_install/dist/lib/dewey.c
U src/external/bsd/pkg_install/dist/lib/dewey.h
U src/external/bsd/pkg_install/dist/lib/fexec.c
U src/external/bsd/pkg_install/dist/lib/file.c
U src/external/bsd/pkg_install/dist/lib/global.c
U src/external/bsd/pkg_install/dist/lib/gpgsig.c
U src/external/bsd/pkg_install/dist/lib/iterate.c
U src/external/bsd/pkg_install/dist/lib/lib.h
U src/external/bsd/pkg_install/dist/lib/license.c
U src/external/bsd/pkg_install/dist/lib/lpkg.c
U src/external/bsd/pkg_install/dist/lib/opattern.c
U src/external/bsd/pkg_install/dist/lib/parse-config.c
U src/external/bsd/pkg_install/dist/lib/pkcs7.c
U src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
U src/external/bsd/pkg_install/dist/lib/pkg_io.c
U src/external/bsd/pkg_install/dist/lib/pkg_signature.c
U src/external/bsd/pkg_install/dist/lib/pkg_summary.5
U src/external/bsd/pkg_install/dist/lib/pkgdb.c
U src/external/bsd/pkg_install/dist/lib/pkgsrc.7
U src/external/bsd/pkg_install/dist/lib/plist.c
U src/external/bsd/pkg_install/dist/lib/remove.c
U src/external/bsd/pkg_install/dist/lib/str.c
U src/external/bsd/pkg_install/dist/lib/var.c
U src/external/bsd/pkg_install/dist/lib/version.c
U src/external/bsd/pkg_install/dist/lib/version.h
U src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
U src/external/bsd/pkg_install/dist/lib/xwrapper.c
U src/external/bsd/pkg_install/dist/x509/pkgsrc.cnf
U src/external/bsd/pkg_install/dist/x509/pkgsrc.sh
U src/external/bsd/pkg_install/dist/x509/signing.txt

No conflicts created by this import



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 19:02:37 UTC 2020

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

Log Message:
make(1): split ParseGetLine into separate functions


To generate a diff of this commit:
cvs rdiff -u -r1.484 -r1.485 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.484 src/usr.bin/make/parse.c:1.485
--- src/usr.bin/make/parse.c:1.484	Fri Dec 18 18:23:29 2020
+++ src/usr.bin/make/parse.c	Fri Dec 18 19:02:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.484 2020/12/18 18:23:29 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.485 2020/12/18 19:02:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.484 2020/12/18 18:23:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.485 2020/12/18 19:02:37 rillig Exp $");
 
 /* types and constants */
 
@@ -2656,6 +2656,75 @@ ParseEOF(void)
 	return TRUE;
 }
 
+static void
+UnescapeBackslash(char **out_tp, char **out_ptr, char **inout_escaped,
+		  char *const line) {
+	char *tp, *ptr;
+	char *escaped = *inout_escaped;
+
+	tp = ptr = escaped;
+	escaped = line;
+	for (;;) {
+		char ch = *ptr++;
+		if (ch != '\\') {
+			if (ch == '\0')
+break;
+			*tp++ = ch;
+			continue;
+		}
+
+		ch = *ptr++;
+		if (ch == '\0') {
+			/* Delete '\\' at end of buffer */
+			tp--;
+			break;
+		}
+
+		/* Delete '\\' from before '#' on non-command lines */
+		if (ch == '#' && line[0] != '\t') {
+			*tp++ = ch;
+			continue;
+		}
+
+		if (ch != '\n') {
+			/* Leave '\\' in buffer for later */
+			*tp++ = '\\';
+			/*
+			 * Make sure we don't delete an escaped ' ' from the
+			 * line end.
+			 */
+			escaped = tp + 1;
+			*tp++ = ch;
+			continue;
+		}
+
+		/*
+		 * Escaped '\n' -- replace following whitespace with a single
+		 * ' '.
+		 */
+		pp_skip_hspace(&ptr);
+		ch = ' ';
+		*tp++ = ch;
+	}
+
+	*out_tp = tp;
+	*out_ptr = ptr;
+	*inout_escaped = escaped;
+}
+
+/* Delete any trailing spaces - eg from empty continuations */
+static void
+TrimRight(char **inout_tp, const char * const escaped)
+{
+	char *tp = *inout_tp;
+
+	while (tp > escaped && ch_isspace(tp[-1]))
+		tp--;
+	*tp = '\0';
+
+	*inout_tp = tp;
+}
+
 typedef enum GetLineMode {
 	PARSE_NORMAL,
 	PARSE_RAW,
@@ -2773,51 +2842,10 @@ ParseGetLine(GetLineMode mode)
 		return line;
 
 	/* Remove escapes from '\n' and '#' */
-	tp = ptr = escaped;
-	escaped = line;
-	for (;; *tp++ = ch) {
-		ch = *ptr++;
-		if (ch != '\\') {
-			if (ch == '\0')
-break;
-			continue;
-		}
+	UnescapeBackslash(&tp, &ptr, &escaped, line);
 
-		ch = *ptr++;
-		if (ch == '\0') {
-			/* Delete '\\' at end of buffer */
-			tp--;
-			break;
-		}
+	TrimRight(&tp, escaped);
 
-		if (ch == '#' && line[0] != '\t')
-			/* Delete '\\' from before '#' on non-command lines */
-			continue;
-
-		if (ch != '\n') {
-			/* Leave '\\' in buffer for later */
-			*tp++ = '\\';
-			/*
-			 * Make sure we don't delete an escaped ' ' from the
-			 * line end.
-			 */
-			escaped = tp + 1;
-			continue;
-		}
-
-		/*
-		 * Escaped '\n' -- replace following whitespace with a single
-		 * ' '.
-		 */
-		pp_skip_hspace(&ptr);
-		ch = ' ';
-	}
-
-	/* Delete any trailing spaces - eg from empty continuations */
-	while (tp > escaped && ch_isspace(tp[-1]))
-		tp--;
-
-	*tp = '\0';
 	return line;
 }
 



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 18:23:29 UTC 2020

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

Log Message:
make(1): separate ParseGetLine into paragraphs


To generate a diff of this commit:
cvs rdiff -u -r1.483 -r1.484 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.483 src/usr.bin/make/parse.c:1.484
--- src/usr.bin/make/parse.c:1.483	Tue Dec 15 00:32:26 2020
+++ src/usr.bin/make/parse.c	Fri Dec 18 18:23:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.483 2020/12/15 00:32:26 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.484 2020/12/18 18:23:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.483 2020/12/15 00:32:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.484 2020/12/18 18:23:29 rillig Exp $");
 
 /* types and constants */
 
@@ -2688,6 +2688,7 @@ ParseGetLine(GetLineMode mode)
 ch = '\0';
 break;
 			}
+
 			ch = *ptr;
 			if (ch == '\0' ||
 			(ch == '\\' && ptr + 1 < cf->buf_end &&
@@ -2697,11 +2698,11 @@ ParseGetLine(GetLineMode mode)
 return NULL;
 			}
 
+			/*
+			 * Don't treat next character after '\' as special,
+			 * remember first one.
+			 */
 			if (ch == '\\') {
-/*
- * Don't treat next character as special,
- * remember first one.
- */
 if (escaped == NULL)
 	escaped = ptr;
 if (ptr[1] == '\n')
@@ -2710,25 +2711,23 @@ ParseGetLine(GetLineMode mode)
 line_end = ptr;
 continue;
 			}
-			if (ch == '#' && comment == NULL) {
-/*
- * Remember the first '#' for comment
- * stripping, unless the previous char was
- * '[', as in the modifier ':[#]'.
- */
-if (!(ptr > line && ptr[-1] == '['))
-	comment = line_end;
-			}
+
+			/*
+			 * Remember the first '#' for comment stripping,
+			 * unless the previous char was '[', as in the
+			 * modifier ':[#]'.
+			 */
+			if (ch == '#' && comment == NULL &&
+			!(ptr > line && ptr[-1] == '['))
+comment = line_end;
+
 			ptr++;
 			if (ch == '\n')
 break;
-			if (!ch_isspace(ch)) {
-/*
- * We are not interested in trailing
- * whitespace.
- */
+
+			/* We are not interested in trailing whitespace. */
+			if (!ch_isspace(ch))
 line_end = ptr;
-			}
 		}
 
 		/* Save next 'to be processed' location */



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 18:17:45 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
make(1): support using C99 bool for Boolean


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/make/make.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/make/make.h
diff -u src/usr.bin/make/make.h:1.234 src/usr.bin/make/make.h:1.235
--- src/usr.bin/make/make.h:1.234	Sun Dec 13 20:09:02 2020
+++ src/usr.bin/make/make.h	Fri Dec 18 18:17:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.234 2020/12/13 20:09:02 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.235 2020/12/18 18:17:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -136,8 +136,12 @@
  * A boolean type is defined as an integer, not an enum, for historic reasons.
  * The only allowed values are the constants TRUE and FALSE (1 and 0).
  */
-
-#ifdef USE_DOUBLE_BOOLEAN
+#if defined(USE_C99_BOOLEAN)
+#include 
+typedef bool Boolean;
+#define FALSE false
+#define TRUE true
+#elif defined(USE_DOUBLE_BOOLEAN)
 /* During development, to find type mismatches in function declarations. */
 typedef double Boolean;
 #define TRUE 1.0



CVS import: src/external/bsd/pkg_install/dist

2020-12-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 18 17:19:17 UTC 2020

Update of /cvsroot/src/external/bsd/pkg_install/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv8075

Log Message:
import pkg_install version 20201218 from pkgsrc

- Support continuing to install to /var/db/pkg if it exists and the
new pkgdb doesn't.
In the future, we can warn about this once we have tested advice that
we can give to users who want to move the location of pkgdb.

- Don't do anything about /var/db/pkg on non-NetBSD-base.
This creates conflicts with other package managers that also install to
/var/db/pkg.

Status:

Vendor Tag: PKGSRC
Release Tags:   pkg-install-20201218

U src/external/bsd/pkg_install/dist/Makefile.in
U src/external/bsd/pkg_install/dist/README
U src/external/bsd/pkg_install/dist/config.guess
U src/external/bsd/pkg_install/dist/config.sub
C src/external/bsd/pkg_install/dist/configure
C src/external/bsd/pkg_install/dist/configure.ac
U src/external/bsd/pkg_install/dist/install-sh
U src/external/bsd/pkg_install/dist/tkpkg
N src/external/bsd/pkg_install/dist/diff
C src/external/bsd/pkg_install/dist/add/Makefile.in
U src/external/bsd/pkg_install/dist/add/add.h
U src/external/bsd/pkg_install/dist/add/main.c
U src/external/bsd/pkg_install/dist/add/perform.c
U src/external/bsd/pkg_install/dist/add/pkg_add.1
C src/external/bsd/pkg_install/dist/add/pkg_add.cat
U src/external/bsd/pkg_install/dist/admin/Makefile.in
U src/external/bsd/pkg_install/dist/admin/admin.h
U src/external/bsd/pkg_install/dist/admin/audit-packages.8
U src/external/bsd/pkg_install/dist/admin/audit-packages.cat
U src/external/bsd/pkg_install/dist/admin/audit-packages.sh.in
U src/external/bsd/pkg_install/dist/admin/audit.c
U src/external/bsd/pkg_install/dist/admin/check.c
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.8
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.cat
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.sh.in
U src/external/bsd/pkg_install/dist/admin/main.c
U src/external/bsd/pkg_install/dist/admin/pkg_admin.1
C src/external/bsd/pkg_install/dist/admin/pkg_admin.cat
C src/external/bsd/pkg_install/dist/create/Makefile.in
U src/external/bsd/pkg_install/dist/create/build.c
U src/external/bsd/pkg_install/dist/create/create.h
U src/external/bsd/pkg_install/dist/create/main.c
U src/external/bsd/pkg_install/dist/create/perform.c
U src/external/bsd/pkg_install/dist/create/pkg_create.1
C src/external/bsd/pkg_install/dist/create/pkg_create.cat
U src/external/bsd/pkg_install/dist/create/pl.c
U src/external/bsd/pkg_install/dist/create/util.c
U src/external/bsd/pkg_install/dist/delete/Makefile.in
U src/external/bsd/pkg_install/dist/delete/pkg_delete.1
U src/external/bsd/pkg_install/dist/delete/pkg_delete.c
C src/external/bsd/pkg_install/dist/delete/pkg_delete.cat
U src/external/bsd/pkg_install/dist/info/Makefile.in
U src/external/bsd/pkg_install/dist/info/info.h
U src/external/bsd/pkg_install/dist/info/main.c
U src/external/bsd/pkg_install/dist/info/perform.c
U src/external/bsd/pkg_install/dist/info/pkg_info.1
C src/external/bsd/pkg_install/dist/info/pkg_info.cat
U src/external/bsd/pkg_install/dist/info/show.c
C src/external/bsd/pkg_install/dist/lib/Makefile.in
U src/external/bsd/pkg_install/dist/lib/automatic.c
U src/external/bsd/pkg_install/dist/lib/config.h.in
U src/external/bsd/pkg_install/dist/lib/conflicts.c
U src/external/bsd/pkg_install/dist/lib/defs.h
U src/external/bsd/pkg_install/dist/lib/dewey.c
U src/external/bsd/pkg_install/dist/lib/dewey.h
U src/external/bsd/pkg_install/dist/lib/fexec.c
U src/external/bsd/pkg_install/dist/lib/file.c
U src/external/bsd/pkg_install/dist/lib/global.c
U src/external/bsd/pkg_install/dist/lib/gpgsig.c
U src/external/bsd/pkg_install/dist/lib/iterate.c
U src/external/bsd/pkg_install/dist/lib/lib.h
U src/external/bsd/pkg_install/dist/lib/license.c
U src/external/bsd/pkg_install/dist/lib/lpkg.c
U src/external/bsd/pkg_install/dist/lib/opattern.c
U src/external/bsd/pkg_install/dist/lib/parse-config.c
U src/external/bsd/pkg_install/dist/lib/pkcs7.c
U src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
C src/external/bsd/pkg_install/dist/lib/pkg_install.conf.cat.in
U src/external/bsd/pkg_install/dist/lib/pkg_io.c
U src/external/bsd/pkg_install/dist/lib/pkg_signature.c
U src/external/bsd/pkg_install/dist/lib/pkg_summary.5
C src/external/bsd/pkg_install/dist/lib/pkg_summary.cat
C src/external/bsd/pkg_install/dist/lib/pkgdb.c
U src/external/bsd/pkg_install/dist/lib/pkgsrc.7
C src/external/bsd/pkg_install/dist/lib/pkgsrc.cat
C src/external/bsd/pkg_install/dist/lib/plist.c
U src/external/bsd/pkg_install/dist/lib/remove.c
U src/external/bsd/pkg_install/dist/lib/str.c
U src/external/bsd/pkg_install/dist/lib/var.c
U src/external/bsd/pkg_install/dist/lib/version.c
C src/external/bsd/pkg_install/dist/lib/version.h
U src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
U src/external/bsd/pkg_in

CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 15:47:34 UTC 2020

Modified Files:
src/usr.bin/make: arch.c make.c suff.c targ.c
src/usr.bin/make/PSD.doc: tutorial.ms
src/usr.bin/make/unit-tests: depsrc-optional.exp

Log Message:
make(1): spell nonexistent consistently


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/make/arch.c
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/make.c
cvs rdiff -u -r1.330 -r1.331 src/usr.bin/make/suff.c
cvs rdiff -u -r1.158 -r1.159 src/usr.bin/make/targ.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/PSD.doc/tutorial.ms
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/depsrc-optional.exp

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.188 src/usr.bin/make/arch.c:1.189
--- src/usr.bin/make/arch.c:1.188	Sun Dec 13 20:14:48 2020
+++ src/usr.bin/make/arch.c	Fri Dec 18 15:47:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.188 2020/12/13 20:14:48 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.189 2020/12/18 15:47:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.188 2020/12/13 20:14:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.189 2020/12/18 15:47:34 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -903,7 +903,7 @@ Arch_UpdateMTime(GNode *gn)
 		gn->mtime = 0;
 }
 
-/* Given a non-existent archive member's node, update gn->mtime from its
+/* Given a nonexistent archive member's node, update gn->mtime from its
  * archived form, if it exists. */
 void
 Arch_UpdateMemberMTime(GNode *gn)

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.230 src/usr.bin/make/make.c:1.231
--- src/usr.bin/make/make.c:1.230	Fri Dec 18 14:46:44 2020
+++ src/usr.bin/make/make.c	Fri Dec 18 15:47:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.230 2020/12/18 14:46:44 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.231 2020/12/18 15:47:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.230 2020/12/18 14:46:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.231 2020/12/18 15:47:34 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -202,7 +202,7 @@ IsOODateRegular(GNode *gn)
 	}
 
 	if (gn->mtime == 0 && !(gn->type & OP_OPTIONAL)) {
-		DEBUG0(MAKE, "non-existent and no sources...");
+		DEBUG0(MAKE, "nonexistent and no sources...");
 		return TRUE;
 	}
 
@@ -241,7 +241,7 @@ GNode_IsOODate(GNode *gn)
 debug_printf("modified %s...",
 Targ_FmtTime(gn->mtime));
 			else
-debug_printf("non-existent...");
+debug_printf("nonexistent...");
 		}
 	}
 
@@ -275,7 +275,7 @@ GNode_IsOODate(GNode *gn)
 
 		/*
 		 * always out of date if no children and :: target
-		 * or non-existent.
+		 * or nonexistent.
 		 */
 		oodate = (gn->mtime == 0 || Arch_LibOODate(gn) ||
 			  (gn->youngestChild == NULL &&
@@ -309,10 +309,10 @@ GNode_IsOODate(GNode *gn)
 		oodate = TRUE;
 	} else {
 		/*
-		 * When a non-existing child with no sources
+		 * When a nonexistent child with no sources
 		 * (such as a typically used FORCE source) has been made and
 		 * the target of the child (usually a directory) has the same
-		 * timestamp as the timestamp just given to the non-existing
+		 * timestamp as the timestamp just given to the nonexistent
 		 * child after it was considered made.
 		 */
 		if (DEBUG(MAKE)) {

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.330 src/usr.bin/make/suff.c:1.331
--- src/usr.bin/make/suff.c:1.330	Sun Dec 13 20:14:48 2020
+++ src/usr.bin/make/suff.c	Fri Dec 18 15:47:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.330 2020/12/13 20:14:48 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.331 2020/12/18 15:47:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.330 2020/12/13 20:14:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.331 2020/12/18 15:47:34 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -2012,7 +2012,7 @@ CandidateSearcher_CleanUp(CandidateSearc
  * is set for the given node and all its implied children.
  *
  * The path found by this target is the shortest path in the transformation
- * graph, which may pass through non-existent targets, to an existing target.
+ * graph, which may pass through nonexistent targets, to an existing target.
  * The search continues on all paths from the root suffix until a file is
  * found. I.e. if there's a path .o -> .c -> .l -> .l,v from the root and the
  * .l,v file exists but the .c and .l files don't,

CVS commit: src/sys/kern

2020-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec 18 15:33:34 UTC 2020

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

Log Message:
While we are inside ddb, allow all memory access.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/subr_asan.c

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

Modified files:

Index: src/sys/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.26 src/sys/kern/subr_asan.c:1.27
--- src/sys/kern/subr_asan.c:1.26	Thu Sep 10 14:10:46 2020
+++ src/sys/kern/subr_asan.c	Fri Dec 18 15:33:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.26 2020/09/10 14:10:46 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.27 2020/12/18 15:33:34 martin Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.26 2020/09/10 14:10:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.27 2020/12/18 15:33:34 martin Exp $");
 
 #include 
 #include 
@@ -42,6 +42,11 @@ __KERNEL_RCSID(0, "$NetBSD: subr_asan.c,
 
 #include 
 
+#ifdef DDB
+#include 
+#include 
+#endif
+
 #ifdef KASAN_PANIC
 #define REPORT panic
 #else
@@ -391,6 +396,10 @@ kasan_shadow_check(unsigned long addr, s
 
 	if (__predict_false(!kasan_enabled))
 		return;
+#ifdef DDB
+	if (__predict_false(db_recover != NULL))
+		return;
+#endif
 	if (__predict_false(size == 0))
 		return;
 	if (__predict_false(kasan_md_unsupported(addr)))



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 14:46:44 UTC 2020

Modified Files:
src/usr.bin/make: make.c targ.c
src/usr.bin/make/unit-tests: depsrc-optional.exp

Log Message:
make(1): use symbolic time for 0 in Make_Recheck

This makes the test depsrc-optional independent from the current time
zone.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/make/make.c
cvs rdiff -u -r1.157 -r1.158 src/usr.bin/make/targ.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/depsrc-optional.exp

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/make.c
diff -u src/usr.bin/make/make.c:1.229 src/usr.bin/make/make.c:1.230
--- src/usr.bin/make/make.c:1.229	Tue Dec 15 20:17:08 2020
+++ src/usr.bin/make/make.c	Fri Dec 18 14:46:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.229 2020/12/15 20:17:08 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.230 2020/12/18 14:46:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.229 2020/12/15 20:17:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.230 2020/12/18 14:46:44 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -539,7 +539,8 @@ Make_Recheck(GNode *gn)
 	if (!GNode_ShouldExecute(gn) || (gn->type & OP_SAVE_CMDS) ||
 	(mtime == 0 && !(gn->type & OP_WAIT))) {
 		DEBUG2(MAKE, " recheck(%s): update time from %s to now\n",
-		gn->name, Targ_FmtTime(gn->mtime));
+		gn->name,
+		gn->mtime == 0 ? "nonexistent" : Targ_FmtTime(gn->mtime));
 		gn->mtime = now;
 	} else {
 		DEBUG2(MAKE, " recheck(%s): current update time: %s\n",

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.157 src/usr.bin/make/targ.c:1.158
--- src/usr.bin/make/targ.c:1.157	Fri Dec 18 14:36:46 2020
+++ src/usr.bin/make/targ.c	Fri Dec 18 14:46:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.157 2020/12/18 14:36:46 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.158 2020/12/18 14:46:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -113,7 +113,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.157 2020/12/18 14:36:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.158 2020/12/18 14:46:44 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -401,17 +401,15 @@ Targ_PrintCmds(GNode *gn)
 
 /*
  * Format a modification time in some reasonable way and return it.
- * The time is placed in a static area, so it is overwritten with each call.
+ * The formatted time is placed in a static area, so it is overwritten
+ * with each call.
  */
 const char *
 Targ_FmtTime(time_t tm)
 {
-	struct tm *parts;
 	static char buf[128];
 
-	/* TODO: Add special case for 0, which often means ENOENT, to make it
-	 * independent from time zones. */
-	parts = localtime(&tm);
+	struct tm *parts = localtime(&tm);
 	(void)strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts);
 	return buf;
 }

Index: src/usr.bin/make/unit-tests/depsrc-optional.exp
diff -u src/usr.bin/make/unit-tests/depsrc-optional.exp:1.5 src/usr.bin/make/unit-tests/depsrc-optional.exp:1.6
--- src/usr.bin/make/unit-tests/depsrc-optional.exp:1.5	Sun Nov  8 11:05:58 2020
+++ src/usr.bin/make/unit-tests/depsrc-optional.exp	Fri Dec 18 14:46:44 2020
@@ -8,13 +8,13 @@ Make_ExpandUse: examine optional-cohort
 Examining optional...non-existent...up-to-date.
 Examining optional-cohort...non-existent...:: operator and no sources...out-of-date.
 : A leaf node using '::' is considered out-of-date.
- recheck(optional-cohort): update time from  0:00:00 Jan 01, 1970 to now
+ recheck(optional-cohort): update time from nonexistent to now
 Examining important...non-existent...modified before source "optional-cohort"...out-of-date.
 : important is made.
- recheck(important): update time from  0:00:00 Jan 01, 1970 to now
+ recheck(important): update time from nonexistent to now
 Examining all...non-existent...modified before source "important"...out-of-date.
 : all is made.
- recheck(all): update time from  0:00:00 Jan 01, 1970 to now
+ recheck(all): update time from nonexistent to now
 Examining .END...non-existent...non-existent and no sources...out-of-date.
- recheck(.END): update time from  0:00:00 Jan 01, 1970 to now
+ recheck(.END): update time from nonexistent to now
 exit status 0



CVS commit: src/usr.bin/make

2020-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 18 14:36:46 UTC 2020

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

Log Message:
make(1): constify Targ_FmtTime


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.156 -r1.157 src/usr.bin/make/targ.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/nonints.h
diff -u src/usr.bin/make/nonints.h:1.172 src/usr.bin/make/nonints.h:1.173
--- src/usr.bin/make/nonints.h:1.172	Tue Dec 15 20:39:15 2020
+++ src/usr.bin/make/nonints.h	Fri Dec 18 14:36:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.172 2020/12/15 20:39:15 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.173 2020/12/18 14:36:46 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -218,7 +218,7 @@ void Targ_SetMain(GNode *);
 void Targ_PrintCmds(GNode *);
 void Targ_PrintNode(GNode *, int);
 void Targ_PrintNodes(GNodeList *, int);
-char *Targ_FmtTime(time_t);
+const char *Targ_FmtTime(time_t);
 void Targ_PrintType(int);
 void Targ_PrintGraph(int);
 void Targ_Propagate(void);

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.156 src/usr.bin/make/targ.c:1.157
--- src/usr.bin/make/targ.c:1.156	Tue Dec 15 21:19:47 2020
+++ src/usr.bin/make/targ.c	Fri Dec 18 14:36:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.156 2020/12/15 21:19:47 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.157 2020/12/18 14:36:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -113,7 +113,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.156 2020/12/15 21:19:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.157 2020/12/18 14:36:46 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -403,7 +403,7 @@ Targ_PrintCmds(GNode *gn)
  * Format a modification time in some reasonable way and return it.
  * The time is placed in a static area, so it is overwritten with each call.
  */
-char *
+const char *
 Targ_FmtTime(time_t tm)
 {
 	struct tm *parts;



CVS commit: [netbsd-9] src/doc

2020-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec 18 12:29:41 UTC 2020

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

Log Message:
Tickets #1153 and #1154


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-9.2

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.2
diff -u src/doc/CHANGES-9.2:1.1.2.23 src/doc/CHANGES-9.2:1.1.2.24
--- src/doc/CHANGES-9.2:1.1.2.23	Mon Dec 14 17:30:35 2020
+++ src/doc/CHANGES-9.2	Fri Dec 18 12:29:41 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.23 2020/12/14 17:30:35 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.24 2020/12/18 12:29:41 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1242,3 +1242,15 @@ sys/arch/hp300/conf/RAMDISK			1.16
 	Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.
 	[tsutsui, ticket #1152]
 
+usr.bin/vmstat/vmstat.c1.232 (patch)
+
+	Move the time nlist fetches into their own namelist and only
+	fetch them when necessary.  Allow for fallback uses of older
+	time sources if others are not present.
+	[mrg, ticket #1153]
+
+external/bsd/dhcpcd/dist/src/dhcp.c		(apply patch)
+
+	Fix reading of UDP messages via inet socket rather than BPF.
+	[roy, ticket #1154]
+



CVS commit: [netbsd-9] src/external/bsd/dhcpcd/dist/src

2020-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec 18 12:27:29 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src [netbsd-9]: dhcp.c

Log Message:
Apply patch, requested by roy in ticket #1154:

external/bsd/dhcpcd/dist/src/dhcp.c (apply patch)

Fix reading of UDP messages via inet socket rather than BPF.
This fixes RENEW messages not being read correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.8 -r1.23.2.9 src/external/bsd/dhcpcd/dist/src/dhcp.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/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.8 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.9
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.8	Thu Apr 23 12:06:09 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Fri Dec 18 12:27:28 2020
@@ -3521,7 +3521,7 @@ dhcp_readudp(struct dhcpcd_ctx *ctx, str
 	struct msghdr msg = {
 	.msg_name = &from, .msg_namelen = sizeof(from),
 	.msg_iov = &iov, .msg_iovlen = 1,
-	.msg_control = buf, .msg_controllen = sizeof(cmsgbuf.buf),
+	.msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
 	};
 	int s;
 	ssize_t bytes;



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

2020-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec 18 12:23:16 UTC 2020

Modified Files:
src/usr.bin/vmstat [netbsd-9]: vmstat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1153):

usr.bin/vmstat/vmstat.c: revision 1.232 (patch)

move the time nlist fetches into their own namelist and only
fetch them when necessary.  allow for fallback uses of older
time sources if others are not present.

this stops vmstat from exiting if it can't get the addresses
of these time values it often doesn't need (eg, running kernels
use the sysctl method), which has cropped up recently wit the
removal of boottime variable.

a slighly modified version of this patch (modified to handle
the old boottime variable over the new one) works against a
netbsd-9 vmstat in -current too.
XXX: pullup


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.227.2.1 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.227 src/usr.bin/vmstat/vmstat.c:1.227.2.1
--- src/usr.bin/vmstat/vmstat.c:1.227	Thu May  9 08:01:07 2019
+++ src/usr.bin/vmstat/vmstat.c	Fri Dec 18 12:23:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.227 2019/05/09 08:01:07 mrg Exp $ */
+/* $NetBSD: vmstat.c,v 1.227.2.1 2020/12/18 12:23:16 martin Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.227 2019/05/09 08:01:07 mrg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.227.2.1 2020/12/18 12:23:16 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -147,27 +147,36 @@ struct cpu_info {
  */
 struct nlist namelist[] =
 {
-#define	X_BOOTTIME	0
-	{ .n_name = "_boottime" },
-#define	X_HZ		1
+#define	X_HZ		0
 	{ .n_name = "_hz" },
-#define	X_STATHZ	2
+#define	X_STATHZ	1
 	{ .n_name = "_stathz" },
-#define	X_NCHSTATS	3
+#define	X_NCHSTATS	2
 	{ .n_name = "_nchstats" },
-#define	X_ALLEVENTS	4
+#define	X_ALLEVENTS	3
 	{ .n_name = "_allevents" },
-#define	X_POOLHEAD	5
+#define	X_POOLHEAD	4
 	{ .n_name = "_pool_head" },
-#define	X_UVMEXP	6
+#define	X_UVMEXP	5
 	{ .n_name = "_uvmexp" },
-#define	X_TIME_SECOND	7
+#define X_CPU_INFOS	6
+	{ .n_name = "_cpu_infos" },
+#define	X_NL_SIZE	7
+	{ .n_name = NULL },
+};
+
+/*
+ * Namelist for time data.
+ */
+struct nlist timenl[] =
+{
+#define	X_BOOTTIME	0
+	{ .n_name = "_boottime" },
+#define	X_TIME_SECOND	1
 	{ .n_name = "_time_second" },
-#define X_TIME		8
+#define X_TIME		2
 	{ .n_name = "_time" },
-#define X_CPU_INFOS	9
-	{ .n_name = "_cpu_infos" },
-#define	X_NL_SIZE	10
+#define	X_TIMENL_SIZE	3
 	{ .n_name = NULL },
 };
 
@@ -552,9 +561,7 @@ getnlist(int todo)
 errx(1, "kvm_nlist: %s %s",
 "namelist", kvm_geterr(kd));
 			for (i = 0; i < __arraycount(namelist)-1; i++)
-if (namelist[i].n_type == 0 &&
-i != X_TIME_SECOND &&
-i != X_TIME) {
+if (namelist[i].n_type == 0) {
 	if (doexit++ == 0)
 		(void)fprintf(stderr,
 		"%s: undefined symbols:",
@@ -568,6 +575,11 @@ getnlist(int todo)
 			}
 		}
 	}
+	if ((todo & (VMSTAT|INTRSTAT)) && !(done & (VMSTAT))) {
+		done |= VMSTAT;
+		if ((c = kvm_nlist(kd, timenl)) == -1 || c == X_TIMENL_SIZE)
+			errx(1, "kvm_nlist: %s %s", "timenl", kvm_geterr(kd));
+	}
 	if ((todo & (SUMSTAT|INTRSTAT)) && !(done & (SUMSTAT|INTRSTAT))) {
 		done |= SUMSTAT|INTRSTAT;
 		(void) kvm_nlist(kd, intrnl);
@@ -636,9 +648,8 @@ getuptime(void)
 		clock_gettime(CLOCK_REALTIME, &now);
 	} else {
 		if (boottime.tv_sec == 0)
-			kread(namelist, X_BOOTTIME, &boottime,
-			sizeof(boottime));
-		if (kreadc(namelist, X_TIME_SECOND, &nowsec, sizeof(nowsec))) {
+			kread(timenl, X_BOOTTIME, &boottime, sizeof(boottime));
+		if (kreadc(timenl, X_TIME_SECOND, &nowsec, sizeof(nowsec))) {
 			/*
 			 * XXX this assignment dance can be removed once
 			 * timeval tv_sec is SUS mandated time_t
@@ -646,7 +657,7 @@ getuptime(void)
 			now.tv_sec = nowsec;
 			now.tv_nsec = 0;
 		} else {
-			kread(namelist, X_TIME, &now, sizeof(now));
+			kread(timenl, X_TIME, &now, sizeof(now));
 		}
 	}
 	uptime = now.tv_sec - boottime.tv_sec;