CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Nov 7 00:07:03 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: archive-suffix.mk varmisc.mk Log Message: make(1): fix references to Var_SetWithFlags in tests To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/archive-suffix.mk cvs rdiff -u -r1.27 -r1.28 src/usr.bin/make/unit-tests/varmisc.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/archive-suffix.mk diff -u src/usr.bin/make/unit-tests/archive-suffix.mk:1.1 src/usr.bin/make/unit-tests/archive-suffix.mk:1.2 --- src/usr.bin/make/unit-tests/archive-suffix.mk:1.1 Sat Aug 29 14:47:26 2020 +++ src/usr.bin/make/unit-tests/archive-suffix.mk Sat Nov 7 00:07:02 2020 @@ -1,7 +1,7 @@ -# $NetBSD: archive-suffix.mk,v 1.1 2020/08/29 14:47:26 rillig Exp $ +# $NetBSD: archive-suffix.mk,v 1.2 2020/11/07 00:07:02 rillig Exp $ # # Between 2020-08-23 and 2020-08-30, the below code produced an assertion -# failure in Var_Set_with_flags, triggered by Compat_Make, when setting the +# failure in Var_SetWithFlags, triggered by Compat_Make, when setting the # .IMPSRC of an archive node to its .TARGET. # # The code assumed that the .TARGET variable of every node would be set, but Index: src/usr.bin/make/unit-tests/varmisc.mk diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.27 src/usr.bin/make/unit-tests/varmisc.mk:1.28 --- src/usr.bin/make/unit-tests/varmisc.mk:1.27 Fri Nov 6 23:11:11 2020 +++ src/usr.bin/make/unit-tests/varmisc.mk Sat Nov 7 00:07:02 2020 @@ -1,4 +1,4 @@ -# $NetBSD: varmisc.mk,v 1.27 2020/11/06 23:11:11 rillig Exp $ +# $NetBSD: varmisc.mk,v 1.28 2020/11/07 00:07:02 rillig Exp $ # # Miscellaneous variable tests. @@ -87,7 +87,7 @@ VARNAME= ${VARNAME${:U1}} .if defined(VARNAME${:U2}) && !empty(VARNAME${:U2}) .endif -# begin .MAKE.SAVE_DOLLARS; see Var_Set_with_flags and ParseBoolean. +# begin .MAKE.SAVE_DOLLARS; see Var_SetWithFlags and ParseBoolean. SD_VALUES= 0 1 2 False True false true Yes No yes no On Off ON OFF on off SD_4_DOLLARS=
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Nov 7 00:06:13 UTC 2020 Modified Files: src/usr.bin/make: job.c nonints.h var.c Log Message: make(1): rename Var_Set_with_flags to Var_SetWithFlags Now that the function is exported from the var module, it should stick to the naming conventions for public functions. To generate a diff of this commit: cvs rdiff -u -r1.304 -r1.305 src/usr.bin/make/job.c cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/nonints.h cvs rdiff -u -r1.670 -r1.671 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.304 src/usr.bin/make/job.c:1.305 --- src/usr.bin/make/job.c:1.304 Fri Nov 6 21:20:31 2020 +++ src/usr.bin/make/job.c Sat Nov 7 00:06:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.304 2020/11/06 21:20:31 rillig Exp $ */ +/* $NetBSD: job.c,v 1.305 2020/11/07 00:06:13 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -143,7 +143,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.304 2020/11/06 21:20:31 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.305 2020/11/07 00:06:13 rillig Exp $"); /* A shell defines how the commands are run. All commands for a target are * written into a single file, which is then given to the shell to execute @@ -2077,7 +2077,7 @@ Shell_Init(void) #endif shellPath = str_concat3(_PATH_DEFSHELLDIR, "/", shellName); } -Var_Set_with_flags(".SHELL", shellPath, VAR_CMDLINE, VAR_SET_READONLY); +Var_SetWithFlags(".SHELL", shellPath, VAR_CMDLINE, VAR_SET_READONLY); if (commandShell->exit == NULL) { commandShell->exit = ""; } Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.152 src/usr.bin/make/nonints.h:1.153 --- src/usr.bin/make/nonints.h:1.152 Sat Nov 7 00:02:54 2020 +++ src/usr.bin/make/nonints.h Sat Nov 7 00:06:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.152 2020/11/07 00:02:54 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.153 2020/11/07 00:06:13 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -288,7 +288,7 @@ typedef enum VarParseResult { void Var_Delete(const char *, GNode *); void Var_Set(const char *, const char *, GNode *); -void Var_Set_with_flags(const char *, const char *, GNode *, VarSetFlags); +void Var_SetWithFlags(const char *, const char *, GNode *, VarSetFlags); void Var_Append(const char *, const char *, GNode *); Boolean Var_Exists(const char *, GNode *); const char *Var_Value(const char *, GNode *, void **); Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.670 src/usr.bin/make/var.c:1.671 --- src/usr.bin/make/var.c:1.670 Sat Nov 7 00:02:54 2020 +++ src/usr.bin/make/var.c Sat Nov 7 00:06:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.670 2020/11/07 00:02:54 rillig Exp $ */ +/* $NetBSD: var.c,v 1.671 2020/11/07 00:06:13 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -130,7 +130,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.670 2020/11/07 00:02:54 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.671 2020/11/07 00:06:13 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -767,8 +767,8 @@ Var_UnExport(const char *str) /* See Var_Set for documentation. */ void -Var_Set_with_flags(const char *name, const char *val, GNode *ctxt, - VarSetFlags flags) +Var_SetWithFlags(const char *name, const char *val, GNode *ctxt, + VarSetFlags flags) { const char *unexpanded_name = name; char *name_freeIt = NULL; @@ -889,7 +889,7 @@ out: void Var_Set(const char *name, const char *val, GNode *ctxt) { -Var_Set_with_flags(name, val, ctxt, 0); +Var_SetWithFlags(name, val, ctxt, 0); } /*- @@ -1457,7 +1457,7 @@ ModifyWord_Loop(const char *word, SepBuf return; args = data; -Var_Set_with_flags(args->tvar, word, args->ctx, VAR_NO_EXPORT); +Var_SetWithFlags(args->tvar, word, args->ctx, VAR_NO_EXPORT); (void)Var_Subst(args->str, args->ctx, args->eflags, ); /* TODO: handle errors */
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Nov 7 00:02:54 UTC 2020 Modified Files: src/usr.bin/make: nonints.h var.c Log Message: make(1): rename VarSet_Flags to VarSetFlags Most other types don't have an underscore as well. To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152 src/usr.bin/make/nonints.h cvs rdiff -u -r1.669 -r1.670 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.151 src/usr.bin/make/nonints.h:1.152 --- src/usr.bin/make/nonints.h:1.151 Fri Nov 6 23:59:21 2020 +++ src/usr.bin/make/nonints.h Sat Nov 7 00:02:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.151 2020/11/06 23:59:21 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.152 2020/11/07 00:02:54 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -229,7 +229,7 @@ typedef enum VarSet_Flags { /* Make the variable read-only. No further modification is possible, * except for another call to Var_Set with the same flag. */ VAR_SET_READONLY = 0x02 -} VarSet_Flags; +} VarSetFlags; /* The state of error handling returned by Var_Parse. * @@ -288,7 +288,7 @@ typedef enum VarParseResult { void Var_Delete(const char *, GNode *); void Var_Set(const char *, const char *, GNode *); -void Var_Set_with_flags(const char *, const char *, GNode *, VarSet_Flags); +void Var_Set_with_flags(const char *, const char *, GNode *, VarSetFlags); void Var_Append(const char *, const char *, GNode *); Boolean Var_Exists(const char *, GNode *); const char *Var_Value(const char *, GNode *, void **); Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.669 src/usr.bin/make/var.c:1.670 --- src/usr.bin/make/var.c:1.669 Fri Nov 6 23:11:11 2020 +++ src/usr.bin/make/var.c Sat Nov 7 00:02:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.669 2020/11/06 23:11:11 rillig Exp $ */ +/* $NetBSD: var.c,v 1.670 2020/11/07 00:02:54 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -130,7 +130,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.669 2020/11/06 23:11:11 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.670 2020/11/07 00:02:54 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -434,7 +434,7 @@ VarFreeEnv(Var *v, Boolean freeValue) /* Add a new variable of the given name and value to the given context. * The name and val arguments are duplicated so they may safely be freed. */ static void -VarAdd(const char *name, const char *val, GNode *ctxt, VarSet_Flags flags) +VarAdd(const char *name, const char *val, GNode *ctxt, VarSetFlags flags) { HashEntry *he = HashTable_CreateEntry(>context, name, NULL); Var *v = VarNew(he->key /* aliased */, NULL, val, @@ -768,7 +768,7 @@ Var_UnExport(const char *str) /* See Var_Set for documentation. */ void Var_Set_with_flags(const char *name, const char *val, GNode *ctxt, - VarSet_Flags flags) + VarSetFlags flags) { const char *unexpanded_name = name; char *name_freeIt = NULL;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 23:59:22 UTC 2020 Modified Files: src/usr.bin/make: arch.c dir.c nonints.h Log Message: make(1): rename Arch_MemMTime to Arch_MemberMTime The abbreviation Mem was ambiguous, it could have meant memory as well. To generate a diff of this commit: cvs rdiff -u -r1.154 -r1.155 src/usr.bin/make/arch.c cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/dir.c cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/nonints.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/arch.c diff -u src/usr.bin/make/arch.c:1.154 src/usr.bin/make/arch.c:1.155 --- src/usr.bin/make/arch.c:1.154 Thu Nov 5 17:27:16 2020 +++ src/usr.bin/make/arch.c Fri Nov 6 23:59:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.154 2020/11/05 17:27:16 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.155 2020/11/06 23:59:21 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -130,7 +130,7 @@ #include "config.h" /* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: arch.c,v 1.154 2020/11/05 17:27:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: arch.c,v 1.155 2020/11/06 23:59:21 rillig Exp $"); #ifdef TARGET_MACHINE #undef MAKE_MACHINE @@ -930,7 +930,7 @@ Arch_MTime(GNode *gn) /* Given a non-existent archive member's node, get its modification time from * its archived form, if it exists. gn->mtime is filled in as well. */ time_t -Arch_MemMTime(GNode *gn) +Arch_MemberMTime(GNode *gn) { GNodeListNode *ln; Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.194 src/usr.bin/make/dir.c:1.195 --- src/usr.bin/make/dir.c:1.194 Thu Nov 5 17:27:16 2020 +++ src/usr.bin/make/dir.c Fri Nov 6 23:59:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.194 2020/11/05 17:27:16 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.195 2020/11/06 23:59:21 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -134,7 +134,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.194 2020/11/05 17:27:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.195 2020/11/06 23:59:21 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -1352,7 +1352,7 @@ Dir_MTime(GNode *gn, Boolean recheck) if (gn->type & OP_MEMBER) { if (fullName != gn->path) free(fullName); - return Arch_MemMTime(gn); + return Arch_MemberMTime(gn); } else { mst.mst_mtime = 0; } Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.150 src/usr.bin/make/nonints.h:1.151 --- src/usr.bin/make/nonints.h:1.150 Fri Nov 6 23:11:11 2020 +++ src/usr.bin/make/nonints.h Fri Nov 6 23:59:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.150 2020/11/06 23:11:11 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.151 2020/11/06 23:59:21 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -80,7 +80,7 @@ Boolean Arch_ParseArchive(char **, GNode void Arch_Touch(GNode *); void Arch_TouchLib(GNode *); time_t Arch_MTime(GNode *); -time_t Arch_MemMTime(GNode *); +time_t Arch_MemberMTime(GNode *); void Arch_FindLib(GNode *, SearchPath *); Boolean Arch_LibOODate(GNode *); Boolean Arch_IsLib(GNode *);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 23:11:11 UTC 2020 Modified Files: src/usr.bin/make: main.c nonints.h var.c src/usr.bin/make/unit-tests: varmisc.mk Log Message: make(1): rename getBoolean and s2Boolean To generate a diff of this commit: cvs rdiff -u -r1.431 -r1.432 src/usr.bin/make/main.c cvs rdiff -u -r1.149 -r1.150 src/usr.bin/make/nonints.h cvs rdiff -u -r1.668 -r1.669 src/usr.bin/make/var.c cvs rdiff -u -r1.26 -r1.27 src/usr.bin/make/unit-tests/varmisc.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/main.c diff -u src/usr.bin/make/main.c:1.431 src/usr.bin/make/main.c:1.432 --- src/usr.bin/make/main.c:1.431 Fri Nov 6 23:05:20 2020 +++ src/usr.bin/make/main.c Fri Nov 6 23:11:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.431 2020/11/06 23:05:20 rillig Exp $ */ +/* $NetBSD: main.c,v 1.432 2020/11/06 23:11:11 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.431 2020/11/06 23:05:20 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.432 2020/11/06 23:11:11 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -863,6 +863,28 @@ PrintVar(const char *varname, Boolean ex } } +/* + * Return a Boolean based on a variable. + * + * If the knob is not set, return the fallback. + * If set, anything that looks or smells like "No", "False", "Off", "0", etc. + * is FALSE, otherwise TRUE. + */ +static Boolean +GetBooleanVar(const char *varname, Boolean fallback) +{ +char *expr = str_concat3("${", varname, ":U}"); +char *value; +Boolean res; + +(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, ); +/* TODO: handle errors */ +res = ParseBoolean(value, fallback); +free(value); +free(expr); +return res; +} + static void doPrintVars(void) { @@ -874,7 +896,7 @@ doPrintVars(void) else if (opts.debugVflag) expandVars = FALSE; else - expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); + expandVars = GetBooleanVar(".MAKE.EXPAND_VARIABLES", FALSE); for (ln = opts.variables->first; ln != NULL; ln = ln->next) { const char *varname = ln->datum; @@ -2037,7 +2059,7 @@ shouldDieQuietly(GNode *gn, int bf) static int quietly = -1; if (quietly < 0) { - if (DEBUG(JOB) || !getBoolean(".MAKE.DIE_QUIETLY", TRUE)) + if (DEBUG(JOB) || !GetBooleanVar(".MAKE.DIE_QUIETLY", TRUE)) quietly = 0; else if (bf >= 0) quietly = bf; @@ -2192,7 +2214,7 @@ mkTempFile(const char *pattern, char **o * is FALSE, otherwise TRUE. */ Boolean -s2Boolean(const char *s, Boolean bf) +ParseBoolean(const char *s, Boolean bf) { switch(s[0]) { case '\0': /* not set - the default wins */ @@ -2211,25 +2233,3 @@ s2Boolean(const char *s, Boolean bf) } return bf; } - -/* - * Return a Boolean based on a variable. - * - * If the knob is not set, return the fallback. - * If set, anything that looks or smells like "No", "False", "Off", "0", etc. - * is FALSE, otherwise TRUE. - */ -Boolean -getBoolean(const char *varname, Boolean fallback) -{ -char *expr = str_concat3("${", varname, ":U}"); -char *value; -Boolean res; - -(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, ); -/* TODO: handle errors */ -res = s2Boolean(value, fallback); -free(value); -free(expr); -return res; -} Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.149 src/usr.bin/make/nonints.h:1.150 --- src/usr.bin/make/nonints.h:1.149 Sun Nov 1 00:24:57 2020 +++ src/usr.bin/make/nonints.h Fri Nov 6 23:11:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.149 2020/11/01 00:24:57 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.150 2020/11/06 23:11:11 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -116,8 +116,7 @@ void Finish(int) MAKE_ATTR_DEAD; int eunlink(const char *); void execDie(const char *, const char *); char *getTmpdir(void); -Boolean s2Boolean(const char *, Boolean); -Boolean getBoolean(const char *, Boolean); +Boolean ParseBoolean(const char *, Boolean); char *cached_realpath(const char *, char *); /* parse.c */ Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.668 src/usr.bin/make/var.c:1.669 --- src/usr.bin/make/var.c:1.668 Fri Nov 6 00:29:50 2020 +++ src/usr.bin/make/var.c Fri Nov 6 23:11:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.668 2020/11/06 00:29:50 rillig Exp $ */ +/* $NetBSD: var.c,v 1.669 2020/11/06 23:11:11 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -130,7 +130,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.668 2020/11/06 00:29:50 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.669 2020/11/06
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 23:05:20 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): fix comment of Error To generate a diff of this commit: cvs rdiff -u -r1.430 -r1.431 src/usr.bin/make/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/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.430 src/usr.bin/make/main.c:1.431 --- src/usr.bin/make/main.c:1.430 Fri Nov 6 23:04:20 2020 +++ src/usr.bin/make/main.c Fri Nov 6 23:05:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.430 2020/11/06 23:04:20 rillig Exp $ */ +/* $NetBSD: main.c,v 1.431 2020/11/06 23:05:20 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.430 2020/11/06 23:04:20 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.431 2020/11/06 23:05:20 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1788,8 +1788,8 @@ bad: /* Print a printf-style error message. * - * This error message has no consequences, in particular it does not affect - * the exit status. */ + * In default mode, this error message has no consequences, in particular it + * does not affect the exit status. Only in lint mode (-dL) it does. */ void Error(const char *fmt, ...) {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 23:04:20 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): clean up Cmd_Exec stylistically To generate a diff of this commit: cvs rdiff -u -r1.429 -r1.430 src/usr.bin/make/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/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.429 src/usr.bin/make/main.c:1.430 --- src/usr.bin/make/main.c:1.429 Fri Nov 6 21:20:31 2020 +++ src/usr.bin/make/main.c Fri Nov 6 23:04:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.429 2020/11/06 21:20:31 rillig Exp $ */ +/* $NetBSD: main.c,v 1.430 2020/11/06 23:04:20 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.429 2020/11/06 21:20:31 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.430 2020/11/06 23:04:20 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1721,10 +1721,7 @@ Cmd_Exec(const char *cmd, const char **e */ switch (cpid = vFork()) { case 0: - /* - * Close input side of pipe - */ - (void)close(fds[0]); + (void)close(fds[0]); /* Close input side of pipe */ /* * Duplicate the output stream to the shell's output, then @@ -1745,36 +1742,26 @@ Cmd_Exec(const char *cmd, const char **e goto bad; default: - /* - * No need for the writing half - */ - (void)close(fds[1]); + (void)close(fds[1]); /* No need for the writing half */ savederr = 0; Buf_Init(, 0); do { - char result[BUFSIZ]; + char result[BUFSIZ]; bytes_read = read(fds[0], result, sizeof result); if (bytes_read > 0) Buf_AddBytes(, result, (size_t)bytes_read); - } - while (bytes_read > 0 || (bytes_read == -1 && errno == EINTR)); + } while (bytes_read > 0 || (bytes_read == -1 && errno == EINTR)); if (bytes_read == -1) savederr = errno; - /* - * Close the input side of the pipe. - */ - (void)close(fds[0]); + (void)close(fds[0]); /* Close the input side of the pipe. */ - /* - * Wait for the process to exit. - */ - while(((pid = waitpid(cpid, , 0)) != cpid) && (pid >= 0)) { + /* Wait for the process to exit. */ + while((pid = waitpid(cpid, , 0)) != cpid && pid >= 0) JobReapChild(pid, status, FALSE); - continue; - } + res_len = Buf_Len(); res = Buf_Destroy(, FALSE);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 22:39:10 UTC 2020 Modified Files: src/usr.bin/make: cond.c make.h Log Message: make(1): merge duplicate code for skipping horizontal whitespace To generate a diff of this commit: cvs rdiff -u -r1.176 -r1.177 src/usr.bin/make/cond.c cvs rdiff -u -r1.195 -r1.196 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/cond.c diff -u src/usr.bin/make/cond.c:1.176 src/usr.bin/make/cond.c:1.177 --- src/usr.bin/make/cond.c:1.176 Fri Nov 6 20:50:48 2020 +++ src/usr.bin/make/cond.c Fri Nov 6 22:39:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.176 2020/11/06 20:50:48 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.177 2020/11/06 22:39:10 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -93,7 +93,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.176 2020/11/06 20:50:48 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.177 2020/11/06 22:39:10 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: @@ -223,9 +223,7 @@ ParseFuncArg(const char **pp, Boolean do return 0; } -while (*p == ' ' || *p == '\t') { - p++; -} +cpp_skip_hspace(); Buf_Init(, 16); @@ -264,9 +262,7 @@ ParseFuncArg(const char **pp, Boolean do *out_arg = Buf_GetAll(, ); Buf_Destroy(, FALSE); -while (*p == ' ' || *p == '\t') { - p++; -} +cpp_skip_hspace(); if (func != NULL && *p++ != ')') { Parse_Error(PARSE_WARNING, "Missing closing parenthesis for %s()", @@ -811,9 +807,7 @@ CondParser_Token(CondParser *par, Boolea return t; } -while (par->p[0] == ' ' || par->p[0] == '\t') { - par->p++; -} +cpp_skip_hspace(>p); switch (par->p[0]) { @@ -1018,8 +1012,7 @@ CondEvalExpression(const struct If *info lhsStrict = strictLHS; -while (*cond == ' ' || *cond == '\t') - cond++; +cpp_skip_hspace(); if (info == NULL && (info = dflt_info) == NULL) { /* Scan for the entry for .if - it can't be first */ @@ -1094,9 +1087,8 @@ Cond_EvalLine(const char *line) cond_state = bmake_malloc(max_if_depth * sizeof *cond_state); cond_state[0] = IF_ACTIVE; } -/* skip leading character (the '.') and any whitespace */ -for (line++; *line == ' ' || *line == '\t'; line++) - continue; +line++; /* skip the leading '.' */ +cpp_skip_hspace(); /* Find what type of if we're dealing with. */ if (line[0] == 'e') { Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.195 src/usr.bin/make/make.h:1.196 --- src/usr.bin/make/make.h:1.195 Fri Nov 6 22:37:07 2020 +++ src/usr.bin/make/make.h Fri Nov 6 22:39:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.195 2020/11/06 22:37:07 rillig Exp $ */ +/* $NetBSD: make.h,v 1.196 2020/11/06 22:39:10 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -729,6 +729,13 @@ cpp_skip_whitespace(const char **pp) } static inline MAKE_ATTR_UNUSED void +cpp_skip_hspace(const char **pp) +{ +while (**pp == ' ' || **pp == '\t') + (*pp)++; +} + +static inline MAKE_ATTR_UNUSED void pp_skip_whitespace(char **pp) { while (ch_isspace(**pp))
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 22:37:07 UTC 2020 Modified Files: src/usr.bin/make: make.h Log Message: make(1): move name of inline functions to the beginning of the line To generate a diff of this commit: cvs rdiff -u -r1.194 -r1.195 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.194 src/usr.bin/make/make.h:1.195 --- src/usr.bin/make/make.h:1.194 Fri Nov 6 21:20:31 2020 +++ src/usr.bin/make/make.h Fri Nov 6 22:37:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.194 2020/11/06 21:20:31 rillig Exp $ */ +/* $NetBSD: make.h,v 1.195 2020/11/06 22:37:07 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -706,20 +706,20 @@ GNode_VarMember(GNode *gn) { return Var_ #define KILLPG(pid, sig) killpg((pid), (sig)) #endif -static inline MAKE_ATTR_UNUSED Boolean ch_isalnum(char ch) -{ return isalnum((unsigned char)ch) != 0; } -static inline MAKE_ATTR_UNUSED Boolean ch_isalpha(char ch) -{ return isalpha((unsigned char)ch) != 0; } -static inline MAKE_ATTR_UNUSED Boolean ch_isdigit(char ch) -{ return isdigit((unsigned char)ch) != 0; } -static inline MAKE_ATTR_UNUSED Boolean ch_isspace(char ch) -{ return isspace((unsigned char)ch) != 0; } -static inline MAKE_ATTR_UNUSED Boolean ch_isupper(char ch) -{ return isupper((unsigned char)ch) != 0; } -static inline MAKE_ATTR_UNUSED char ch_tolower(char ch) -{ return (char)tolower((unsigned char)ch); } -static inline MAKE_ATTR_UNUSED char ch_toupper(char ch) -{ return (char)toupper((unsigned char)ch); } +static inline MAKE_ATTR_UNUSED Boolean +ch_isalnum(char ch) { return isalnum((unsigned char)ch) != 0; } +static inline MAKE_ATTR_UNUSED Boolean +ch_isalpha(char ch) { return isalpha((unsigned char)ch) != 0; } +static inline MAKE_ATTR_UNUSED Boolean +ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; } +static inline MAKE_ATTR_UNUSED Boolean +ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; } +static inline MAKE_ATTR_UNUSED Boolean +ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; } +static inline MAKE_ATTR_UNUSED char +ch_tolower(char ch) { return (char)tolower((unsigned char)ch); } +static inline MAKE_ATTR_UNUSED char +ch_toupper(char ch) { return (char)toupper((unsigned char)ch); } static inline MAKE_ATTR_UNUSED void cpp_skip_whitespace(const char **pp)
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 21:20:31 UTC 2020 Modified Files: src/usr.bin/make: job.c main.c make.h Log Message: make(1): rename dieQuietly to shouldDieQuietly It was too confusing to have a function named die that doesn't actually die. Plus, the return type int didn't give any clue about what the function actually returns. To generate a diff of this commit: cvs rdiff -u -r1.303 -r1.304 src/usr.bin/make/job.c cvs rdiff -u -r1.428 -r1.429 src/usr.bin/make/main.c cvs rdiff -u -r1.193 -r1.194 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/job.c diff -u src/usr.bin/make/job.c:1.303 src/usr.bin/make/job.c:1.304 --- src/usr.bin/make/job.c:1.303 Thu Nov 5 17:27:16 2020 +++ src/usr.bin/make/job.c Fri Nov 6 21:20:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.303 2020/11/05 17:27:16 rillig Exp $ */ +/* $NetBSD: job.c,v 1.304 2020/11/06 21:20:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -143,7 +143,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.303 2020/11/05 17:27:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.304 2020/11/06 21:20:31 rillig Exp $"); /* A shell defines how the commands are run. All commands for a target are * written into a single file, which is then given to the shell to execute @@ -1028,7 +1028,7 @@ JobFinish(Job *job, int status) meta_job_error(job, job->node, job->flags, WEXITSTATUS(status)); } #endif - if (!dieQuietly(job->node, -1)) + if (!shouldDieQuietly(job->node, -1)) (void)printf("*** [%s] Error code %d%s\n", job->node->name, WEXITSTATUS(status), @@ -2767,7 +2767,7 @@ Job_TokenWithdraw(void) /* And put the stopper back */ while (write(tokenWaitJob.outPipe, , 1) == -1 && errno == EAGAIN) continue; - if (dieQuietly(NULL, 1)) + if (shouldDieQuietly(NULL, 1)) exit(2); Fatal("A failure has been detected in another branch of the parallel make"); } Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.428 src/usr.bin/make/main.c:1.429 --- src/usr.bin/make/main.c:1.428 Fri Nov 6 21:01:43 2020 +++ src/usr.bin/make/main.c Fri Nov 6 21:20:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.428 2020/11/06 21:01:43 rillig Exp $ */ +/* $NetBSD: main.c,v 1.429 2020/11/06 21:20:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.428 2020/11/06 21:01:43 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.429 2020/11/06 21:20:31 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1891,7 +1891,7 @@ DieHorribly(void) void Finish(int errs) { - if (dieQuietly(NULL, -1)) + if (shouldDieQuietly(NULL, -1)) exit(2); Fatal("%d error%s", errs, errs == 1 ? "" : "s"); } @@ -2042,11 +2042,10 @@ cached_realpath(const char *pathname, ch /* * Return true if we should die without noise. - * For example our failing child was a sub-make - * or failure happend elsewhere. + * For example our failing child was a sub-make or failure happened elsewhere. */ -int -dieQuietly(GNode *gn, int bf) +Boolean +shouldDieQuietly(GNode *gn, int bf) { static int quietly = -1; @@ -2056,7 +2055,7 @@ dieQuietly(GNode *gn, int bf) else if (bf >= 0) quietly = bf; else - quietly = gn != NULL ? ((gn->type & (OP_MAKE)) != 0) : 0; + quietly = gn != NULL && (gn->type & OP_MAKE); } return quietly; } @@ -2094,7 +2093,7 @@ PrintOnError(GNode *gn, const char *s) } /* we generally want to keep quiet if a sub-make died */ -if (dieQuietly(gn, -1)) +if (shouldDieQuietly(gn, -1)) return; if (s) Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.193 src/usr.bin/make/make.h:1.194 --- src/usr.bin/make/make.h:1.193 Fri Nov 6 21:12:19 2020 +++ src/usr.bin/make/make.h Fri Nov 6 21:20:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.193 2020/11/06 21:12:19 rillig Exp $ */ +/* $NetBSD: make.h,v 1.194 2020/11/06 21:20:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -643,7 +643,7 @@ void Make_HandleUse(GNode *, GNode *); void Make_Update(GNode *); void Make_DoAllVar(GNode *); Boolean Make_Run(GNodeList *); -int dieQuietly(GNode *, int); +Boolean shouldDieQuietly(GNode *, int); void PrintOnError(GNode *, const char *); void Main_ExportMAKEFLAGS(Boolean); Boolean Main_SetObjdir(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 21:12:20 UTC 2020 Modified Files: src/usr.bin/make: make.h Log Message: make(1): document DEBUG_LINT To generate a diff of this commit: cvs rdiff -u -r1.192 -r1.193 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.192 src/usr.bin/make/make.h:1.193 --- src/usr.bin/make/make.h:1.192 Fri Nov 6 21:09:06 2020 +++ src/usr.bin/make/make.h Fri Nov 6 21:12:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.192 2020/11/06 21:09:06 rillig Exp $ */ +/* $NetBSD: make.h,v 1.193 2020/11/06 21:12:19 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -516,6 +516,10 @@ typedef enum DebugFlags { DEBUG_VAR = 1 << 18, DEBUG_FOR = 1 << 19, +/* Runs make in strict mode, with additional checks and better error + * handling. This is not the default mode to preserve compatibility. + * + * XXX: This is not really a debug flag, it doesn't belong here. */ DEBUG_LINT = 1 << 20 } DebugFlags;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 21:09:06 UTC 2020 Modified Files: src/usr.bin/make: make.h Log Message: make(1): sort and renumber debug flags To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 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.191 src/usr.bin/make/make.h:1.192 --- src/usr.bin/make/make.h:1.191 Fri Nov 6 20:24:08 2020 +++ src/usr.bin/make/make.h Fri Nov 6 21:09:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.191 2020/11/06 20:24:08 rillig Exp $ */ +/* $NetBSD: make.h,v 1.192 2020/11/06 21:09:06 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -497,25 +497,24 @@ extern pid_t myPid; typedef enum DebugFlags { DEBUG_ARCH = 1 << 0, DEBUG_COND = 1 << 1, -DEBUG_DIR = 1 << 2, -DEBUG_GRAPH1 = 1 << 3, -DEBUG_GRAPH2 = 1 << 4, -DEBUG_JOB = 1 << 5, -DEBUG_MAKE = 1 << 6, -DEBUG_SUFF = 1 << 7, -DEBUG_TARG = 1 << 8, -DEBUG_VAR = 1 << 9, -DEBUG_FOR = 1 << 10, -DEBUG_SHELL = 1 << 11, -DEBUG_ERROR = 1 << 12, -DEBUG_LOUD = 1 << 13, -DEBUG_META = 1 << 14, -DEBUG_HASH = 1 << 15, - -DEBUG_GRAPH3 = 1 << 16, -DEBUG_SCRIPT = 1 << 17, -DEBUG_PARSE = 1 << 18, -DEBUG_CWD = 1 << 19, +DEBUG_CWD = 1 << 2, +DEBUG_DIR = 1 << 3, +DEBUG_ERROR = 1 << 4, +DEBUG_GRAPH1 = 1 << 5, +DEBUG_GRAPH2 = 1 << 6, +DEBUG_GRAPH3 = 1 << 7, +DEBUG_HASH = 1 << 8, +DEBUG_JOB = 1 << 9, +DEBUG_LOUD = 1 << 10, +DEBUG_MAKE = 1 << 11, +DEBUG_META = 1 << 12, +DEBUG_PARSE = 1 << 13, +DEBUG_SCRIPT = 1 << 14, +DEBUG_SHELL = 1 << 15, +DEBUG_SUFF = 1 << 16, +DEBUG_TARG = 1 << 17, +DEBUG_VAR = 1 << 18, +DEBUG_FOR = 1 << 19, DEBUG_LINT = 1 << 20 } DebugFlags;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 21:01:43 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): fix typo from previous commit To generate a diff of this commit: cvs rdiff -u -r1.427 -r1.428 src/usr.bin/make/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/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.427 src/usr.bin/make/main.c:1.428 --- src/usr.bin/make/main.c:1.427 Fri Nov 6 20:59:52 2020 +++ src/usr.bin/make/main.c Fri Nov 6 21:01:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $ */ +/* $NetBSD: main.c,v 1.428 2020/11/06 21:01:43 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.428 2020/11/06 21:01:43 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -2181,7 +2181,7 @@ mkTempFile(const char *pattern, char **o char tfile[MAXPATHLEN]; int fd; -if (pattern == NULL)h +if (pattern == NULL) pattern = TMPPAT; if (tmpdir == NULL) tmpdir = getTmpdir();
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 20:59:52 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): fix wrong condition in mkTempFile (since 2020-10-31) The wrong negation had been added in main.c 1.414 from 2020-10-31. Found by GCC 10, which complained about a potential null pointer dereference in line 2188. To generate a diff of this commit: cvs rdiff -u -r1.426 -r1.427 src/usr.bin/make/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/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.426 src/usr.bin/make/main.c:1.427 --- src/usr.bin/make/main.c:1.426 Thu Nov 5 17:27:16 2020 +++ src/usr.bin/make/main.c Fri Nov 6 20:59:52 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.426 2020/11/05 17:27:16 rillig Exp $ */ +/* $NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.426 2020/11/05 17:27:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.427 2020/11/06 20:59:52 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -2181,7 +2181,7 @@ mkTempFile(const char *pattern, char **o char tfile[MAXPATHLEN]; int fd; -if (pattern != NULL) +if (pattern == NULL)h pattern = TMPPAT; if (tmpdir == NULL) tmpdir = getTmpdir();
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 20:50:49 UTC 2020 Modified Files: src/usr.bin/make: cond.c Log Message: make(1): fix tests directive-ifmake and varcmd with custom boolean When make is compiled with -DUSE_UCHAR_BOOLEAN, these tests failed. Merge duplicate code and don't depend on the actual value of TRUE when evaluating conditions. To generate a diff of this commit: cvs rdiff -u -r1.175 -r1.176 src/usr.bin/make/cond.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/cond.c diff -u src/usr.bin/make/cond.c:1.175 src/usr.bin/make/cond.c:1.176 --- src/usr.bin/make/cond.c:1.175 Thu Nov 5 17:27:16 2020 +++ src/usr.bin/make/cond.c Fri Nov 6 20:50:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.175 2020/11/05 17:27:16 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.176 2020/11/06 20:50:48 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -93,7 +93,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.175 2020/11/05 17:27:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.176 2020/11/06 20:50:48 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: @@ -502,13 +502,15 @@ cleanup: return str; } -/* The different forms of .if directives. */ -static const struct If { +struct If { const char *form; /* Form of if */ size_t formlen; /* Length of form */ Boolean doNot; /* TRUE if default function should be negated */ Boolean (*defProc)(size_t, const char *); /* Default function to apply */ -} ifs[] = { +}; + +/* The different forms of .if directives. */ +static const struct If ifs[] = { { "def", 3, FALSE, FuncDefined }, { "ndef", 4, TRUE, FuncDefined }, { "make", 4, FALSE, FuncMake }, @@ -517,6 +519,13 @@ static const struct If { { NULL,0, FALSE, NULL } }; +static Boolean +If_Eval(const struct If *if_info, const char *arg, size_t arglen) +{ +Boolean res = if_info->defProc(arglen, arg); +return (if_info->doNot ? !res : res) ? TOK_TRUE : TOK_FALSE; +} + /* Evaluate a "comparison without operator", such as in ".if ${VAR}" or * ".if 0". */ static Token @@ -537,7 +546,7 @@ EvalNotEmpty(CondParser *par, const char return lhs[0] != 0; /* Otherwise action default test ... */ -return par->if_info->defProc(strlen(lhs), lhs) == !par->if_info->doNot; +return If_Eval(par->if_info, lhs, strlen(lhs)); } /* Evaluate a numerical comparison, such as in ".if ${VAR} >= 9". */ @@ -785,7 +794,7 @@ CondParser_Func(CondParser *par, Boolean * after .if must have been taken literally, so the argument cannot * be empty - even if it contained a variable expansion. */ -t = !doEval || par->if_info->defProc(arglen, arg) == !par->if_info->doNot; +t = !doEval || If_Eval(par->if_info, arg, arglen); free(arg); return t; }
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Nov 6 20:29:35 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: directive-ifmake.mk Log Message: make(1): fix indentation in test directive-ifmake To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/directive-ifmake.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/directive-ifmake.mk diff -u src/usr.bin/make/unit-tests/directive-ifmake.mk:1.4 src/usr.bin/make/unit-tests/directive-ifmake.mk:1.5 --- src/usr.bin/make/unit-tests/directive-ifmake.mk:1.4 Sun Aug 30 14:25:45 2020 +++ src/usr.bin/make/unit-tests/directive-ifmake.mk Fri Nov 6 20:29:35 2020 @@ -1,44 +1,44 @@ -# $NetBSD: directive-ifmake.mk,v 1.4 2020/08/30 14:25:45 rillig Exp $ +# $NetBSD: directive-ifmake.mk,v 1.5 2020/11/06 20:29:35 rillig Exp $ # # Tests for the .ifmake directive, which provides a shortcut for asking # whether a certain target is requested to be made from the command line. # This is the most basic form. .ifmake first -.info ok: positive condition works +. info ok: positive condition works .else -.warning positive condition fails +. warning positive condition fails .endif # The not operator works as expected. # An alternative interpretation were that this condition is asking whether # the target "!first" was requested. To distinguish this, see the next test. .ifmake !first -.warning unexpected +. warning unexpected .else -.info ok: negation works +. info ok: negation works .endif # See if the exclamation mark really means "not", or if it is just part of # the target name. .ifmake !!first -.info ok: double negation works +. info ok: double negation works .else -.warning double negation fails +. warning double negation fails .endif # Multiple targets can be combined using the && and || operators. .ifmake first && second -.info ok: both mentioned +. info ok: both mentioned .else -.warning && does not work as expected +. warning && does not work as expected .endif # Negation also works in complex conditions. .ifmake first && !unmentioned -.info ok: only those mentioned +. info ok: only those mentioned .else -.warning && with ! does not work as expected +. warning && with ! does not work as expected .endif # Using the .MAKEFLAGS special dependency target, arbitrary command @@ -46,9 +46,9 @@ # possible to extend the targets to be made. .MAKEFLAGS: late-target .ifmake late-target -.info Targets can even be added at parse time. +. info Targets can even be added at parse time. .else -.info No, targets cannot be added at parse time anymore. +. info No, targets cannot be added at parse time anymore. .endif first second unmentioned late-target:
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 20:24:08 UTC 2020 Modified Files: src/usr.bin/make: make.h Log Message: make(1): document progname To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 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.190 src/usr.bin/make/make.h:1.191 --- src/usr.bin/make/make.h:1.190 Fri Nov 6 20:20:00 2020 +++ src/usr.bin/make/make.h Fri Nov 6 20:24:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.190 2020/11/06 20:20:00 rillig Exp $ */ +/* $NetBSD: make.h,v 1.191 2020/11/06 20:24:08 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -463,9 +463,12 @@ extern SearchPath *sysIncPath; /* The default for sysIncPath. */ extern SearchPath *defSysIncPath; -extern char curdir[]; /* Startup directory */ -extern char *progname; /* The program name */ -extern char *makeDependfile; /* Name of the .depend makefile */ +/* Startup directory */ +extern char curdir[]; +/* The basename of the program name, suffixed with [n] for sub-makes. */ +extern char *progname; +/* Name of the .depend makefile */ +extern char *makeDependfile; /* If we replaced environ, this will be non-NULL. */ extern char **savedEnv;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Nov 6 20:20:00 UTC 2020 Modified Files: src/usr.bin/make: make.h Log Message: make(1): clean up comments in make.h To generate a diff of this commit: cvs rdiff -u -r1.189 -r1.190 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.189 src/usr.bin/make/make.h:1.190 --- src/usr.bin/make/make.h:1.189 Thu Nov 5 00:40:31 2020 +++ src/usr.bin/make/make.h Fri Nov 6 20:20:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.189 2020/11/05 00:40:31 rillig Exp $ */ +/* $NetBSD: make.h,v 1.190 2020/11/06 20:20:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -400,9 +400,7 @@ typedef enum CondEvalResult { COND_INVALID /* Not a conditional statement */ } CondEvalResult; -/* - * Definitions for the "local" variables. Used only for clarity. - */ +/* Names of the variables that are "local" to a specific target. */ #define TARGET "@" /* Target of dependency */ #define OODATE "?" /* All out-of-date sources */ #define ALLSRC ">" /* All sources */ @@ -414,29 +412,30 @@ typedef enum CondEvalResult { /* * Global Variables */ -extern SearchPath *dirSearchPath; -/* The list of directories to search when - * looking for targets */ -extern Boolean allPrecious; /* True if every target is precious */ -extern Boolean deleteOnError; /* True if failed targets should be deleted */ -extern Boolean doing_depend; /* TRUE if processing .depend */ - -extern GNode*DEFAULT; /* .DEFAULT rule */ - -extern GNode *VAR_INTERNAL; /* Variables defined internally by make - * which should not override those set by - * makefiles. - */ -extern GNode*VAR_GLOBAL; /* Variables defined in a global context, e.g - * in the Makefile itself */ -extern GNode*VAR_CMDLINE; /* Variables defined on the command line */ -extern char var_Error[]; /* Value returned by Var_Parse when an error - * is encountered. It actually points to - * an empty string, so naive callers needn't - * worry about it. */ -extern time_t now; /* The time at the start of this whole - * process */ +/* True if every target is precious */ +extern Boolean allPrecious; +/* True if failed targets should be deleted */ +extern Boolean deleteOnError; +/* TRUE while processing .depend */ +extern Boolean doing_depend; +/* .DEFAULT rule */ +extern GNode *DEFAULT; + +/* Variables defined internally by make which should not override those set + * by makefiles. */ +extern GNode *VAR_INTERNAL; +/* Variables defined in a global context, e.g in the Makefile itself. */ +extern GNode *VAR_GLOBAL; +/* Variables defined on the command line. */ +extern GNode *VAR_CMDLINE; + +/* Value returned by Var_Parse when an error is encountered. It actually + * points to an empty string, so naive callers needn't worry about it. */ +extern char var_Error[]; + +/* The time at the start of this whole process */ +extern time_t now; /* * If FALSE (the default behavior), undefined subexpressions in a variable @@ -453,6 +452,9 @@ extern time_t now; /* The time at the s */ extern Boolean preserveUndefined; +/* The list of directories to search when looking for targets (set by the + * special target .PATH). */ +extern SearchPath *dirSearchPath; /* Used for .include "...". */ extern SearchPath *parseIncPath; /* Used for .include <...>, for the built-in sys.mk and makefiles from the @@ -463,18 +465,18 @@ extern SearchPath *defSysIncPath; extern char curdir[]; /* Startup directory */ extern char *progname; /* The program name */ -extern char *makeDependfile; /* .depend */ +extern char *makeDependfile; /* Name of the .depend makefile */ /* If we replaced environ, this will be non-NULL. */ extern char **savedEnv; -extern int makelevel; +extern int makelevel; /* * We cannot vfork() in a child of vfork(). * Most systems do not enforce this but some do. */ #define vFork() ((getpid() == myPid) ? vfork() : fork()) -extern pid_t myPid; +extern pid_t myPid; #define MAKEFLAGS ".MAKEFLAGS" #define MAKEOVERRIDES ".MAKEOVERRIDES"
CVS commit: src/usr.sbin/sysinst/arch/vax
Module Name:src Committed By: martin Date: Fri Nov 6 19:47:31 UTC 2020 Modified Files: src/usr.sbin/sysinst/arch/vax: Makefile Log Message: Minimize the installer for crunched install media To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/vax/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/arch/vax/Makefile diff -u src/usr.sbin/sysinst/arch/vax/Makefile:1.1 src/usr.sbin/sysinst/arch/vax/Makefile:1.2 --- src/usr.sbin/sysinst/arch/vax/Makefile:1.1 Sat Jul 26 19:30:47 2014 +++ src/usr.sbin/sysinst/arch/vax/Makefile Fri Nov 6 19:47:31 2020 @@ -1,8 +1,16 @@ -# $NetBSD: Makefile,v 1.1 2014/07/26 19:30:47 dholland Exp $ +# $NetBSD: Makefile,v 1.2 2020/11/06 19:47:31 martin Exp $ # # Makefile for vax # MD_OPTIONS= AOUT2ELF +.ifdef SMALLPROG +CHECK_ENTROPY= no # do not check entropy/offer adding +NOPARTMAN= yes +NO_GPT= yes +NO_MBR= yes +NO_CLONES= yes +.endif + .include "../../Makefile.inc"
CVS commit: src/sys/arch/evbppc/conf
Module Name:src Committed By: martin Date: Fri Nov 6 18:36:35 UTC 2020 Modified Files: src/sys/arch/evbppc/conf: INSTALL.inc Log Message: Bump ramdisk size slightly To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/conf/INSTALL.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbppc/conf/INSTALL.inc diff -u src/sys/arch/evbppc/conf/INSTALL.inc:1.4 src/sys/arch/evbppc/conf/INSTALL.inc:1.5 --- src/sys/arch/evbppc/conf/INSTALL.inc:1.4 Thu Feb 9 15:24:08 2017 +++ src/sys/arch/evbppc/conf/INSTALL.inc Fri Nov 6 18:36:34 2020 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL.inc,v 1.4 2017/02/09 15:24:08 joerg Exp $ +# $NetBSD: INSTALL.inc,v 1.5 2020/11/06 18:36:34 martin Exp $ # DEBUG options turned on: @@ -17,5 +17,5 @@ options MEMORY_DISK_IS_ROOT # force roo options MEMORY_DISK_SERVER=0 # no userspace memory disk support ## The ramdisk size must be kept in sync manually with the size of ## the `ramdisk' image (which is built in distrib/evbppc/ramdisk/ramdisk). -options MEMORY_DISK_ROOT_SIZE=6560 # size of memory disk, in blocks +options MEMORY_DISK_ROOT_SIZE=7072 # size of memory disk, in blocks options MEMORY_DISK_RBFLAGS=RB_SINGLE # boot in single-user mode
CVS commit: src/distrib/evbppc/ramdisk
Module Name:src Committed By: martin Date: Fri Nov 6 18:36:20 UTC 2020 Modified Files: src/distrib/evbppc/ramdisk: Makefile Log Message: Bump ramdisk size slightly To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/distrib/evbppc/ramdisk/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/evbppc/ramdisk/Makefile diff -u src/distrib/evbppc/ramdisk/Makefile:1.24 src/distrib/evbppc/ramdisk/Makefile:1.25 --- src/distrib/evbppc/ramdisk/Makefile:1.24 Sun Dec 29 18:26:17 2019 +++ src/distrib/evbppc/ramdisk/Makefile Fri Nov 6 18:36:20 2020 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.24 2019/12/29 18:26:17 christos Exp $ +# $NetBSD: Makefile,v 1.25 2020/11/06 18:36:20 martin Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" IMAGE= ramdisk.fs -IMAGESIZE= 3280k +IMAGESIZE= 3536k MAKEFS_FLAGS+= -f 15 WARNS= 1
CVS commit: src/sys/rump/dev/lib
Module Name:src Committed By: christos Date: Fri Nov 6 15:35:33 UTC 2020 Modified Files: src/sys/rump/dev/lib/libpci_usbhc: Makefile PCI_USBHC.ioconf src/sys/rump/dev/lib/libusb: USB.ioconf Log Message: PR/55789: Ruslan Nikolaev: New rump drivers To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/dev/lib/libpci_usbhc/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libusb/USB.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/dev/lib/libpci_usbhc/Makefile diff -u src/sys/rump/dev/lib/libpci_usbhc/Makefile:1.5 src/sys/rump/dev/lib/libpci_usbhc/Makefile:1.6 --- src/sys/rump/dev/lib/libpci_usbhc/Makefile:1.5 Mon Nov 16 18:27:08 2015 +++ src/sys/rump/dev/lib/libpci_usbhc/Makefile Fri Nov 6 10:35:33 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2015/11/16 23:27:08 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2020/11/06 15:35:33 christos Exp $ # RUMPTOP=${TOPRUMP} @@ -14,6 +14,7 @@ RUMP_COMPONENT=ioconf SRCS+= ohci_pci.c ohci.c SRCS+= uhci_pci.c uhci.c SRCS+= ehci_pci.c ehci.c +SRCS+= xhci_pci.c xhci.c SRCS+= usb_pci.c CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/../dev Index: src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf diff -u src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf:1.1 src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf:1.2 --- src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf:1.1 Wed May 20 08:21:38 2015 +++ src/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf Fri Nov 6 10:35:33 2020 @@ -1,4 +1,4 @@ -# $NetBSD: PCI_USBHC.ioconf,v 1.1 2015/05/20 12:21:38 pooka Exp $ +# $NetBSD: PCI_USBHC.ioconf,v 1.2 2020/11/06 15:35:33 christos Exp $ # ioconf pci_usbhc @@ -11,3 +11,4 @@ pseudo-root pci* ohci* at pci? uhci* at pci? ehci* at pci? +xhci* at pci? Index: src/sys/rump/dev/lib/libusb/USB.ioconf diff -u src/sys/rump/dev/lib/libusb/USB.ioconf:1.2 src/sys/rump/dev/lib/libusb/USB.ioconf:1.3 --- src/sys/rump/dev/lib/libusb/USB.ioconf:1.2 Wed May 20 07:51:32 2015 +++ src/sys/rump/dev/lib/libusb/USB.ioconf Fri Nov 6 10:35:33 2020 @@ -1,4 +1,4 @@ -# $NetBSD: USB.ioconf,v 1.2 2015/05/20 11:51:32 pooka Exp $ +# $NetBSD: USB.ioconf,v 1.3 2020/11/06 15:35:33 christos Exp $ # ioconf usb @@ -15,6 +15,7 @@ pseudo-root ugenhc* pseudo-root ehci* pseudo-root ohci* pseudo-root uhci* +pseudo-root xhci* # @@ -25,6 +26,7 @@ usb*at ugenhc? usb* at ehci? usb* at ohci? usb* at uhci? +usb* at xhci? # USB ROOT Hub
CVS commit: src/sys
Module Name:src Committed By: christos Date: Fri Nov 6 14:50:13 UTC 2020 Modified Files: src/sys/kern: uipc_domain.c uipc_usrreq.c src/sys/rump/librump/rumpnet: net_stub.c src/sys/sys: un.h Log Message: PR/55777: Ruslan Nikolaev: Move the unp_sysctl_create to uipc_usrreq.c to facilitate splitting rump modules and does not require a dummy function. To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/kern/uipc_domain.c cvs rdiff -u -r1.199 -r1.200 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.40 -r1.41 src/sys/rump/librump/rumpnet/net_stub.c cvs rdiff -u -r1.58 -r1.59 src/sys/sys/un.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/uipc_domain.c diff -u src/sys/kern/uipc_domain.c:1.107 src/sys/kern/uipc_domain.c:1.108 --- src/sys/kern/uipc_domain.c:1.107 Sat Oct 17 05:45:20 2020 +++ src/sys/kern/uipc_domain.c Fri Nov 6 09:50:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_domain.c,v 1.107 2020/10/17 09:45:20 mlelstv Exp $ */ +/* $NetBSD: uipc_domain.c,v 1.108 2020/11/06 14:50:13 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.107 2020/10/17 09:45:20 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.108 2020/11/06 14:50:13 christos Exp $"); #include #include @@ -692,7 +692,6 @@ sysctl_net_setup(void) SYSCTL_DESCR("SOCK_DGRAM protocol control block list"), sysctl_unpcblist, 0, NULL, 0, CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL); - unp_sysctl_create(_sysctllog); } void Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.199 src/sys/kern/uipc_usrreq.c:1.200 --- src/sys/kern/uipc_usrreq.c:1.199 Wed Aug 26 18:54:30 2020 +++ src/sys/kern/uipc_usrreq.c Fri Nov 6 09:50:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.199 2020/08/26 22:54:30 christos Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.200 2020/11/06 14:50:13 christos Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009, 2020 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.199 2020/08/26 22:54:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.200 2020/11/06 14:50:13 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -196,6 +196,8 @@ static kcondvar_t unp_thread_cv; static lwp_t *unp_thread_lwp; static SLIST_HEAD(,file) unp_thread_discard; static int unp_defer; +static struct sysctllog *usrreq_sysctllog; +static void unp_sysctl_create(void); /* Compat interface */ @@ -219,6 +221,8 @@ uipc_init(void) { int error; + unp_sysctl_create(); + uipc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE); cv_init(_thread_cv, "unpgc"); @@ -1988,40 +1992,42 @@ unp_discard_later(file_t *fp) mutex_exit(_lock); } -void -unp_sysctl_create(struct sysctllog **clog) +static void +unp_sysctl_create(void) { - sysctl_createv(clog, 0, NULL, NULL, + + KASSERT(usrreq_sysctllog == NULL); + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_LONG, "sendspace", SYSCTL_DESCR("Default stream send space"), NULL, 0, _sendspace, 0, CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_LONG, "recvspace", SYSCTL_DESCR("Default stream recv space"), NULL, 0, _recvspace, 0, CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_LONG, "sendspace", SYSCTL_DESCR("Default datagram send space"), NULL, 0, _sendspace, 0, CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_LONG, "recvspace", SYSCTL_DESCR("Default datagram recv space"), NULL, 0, _recvspace, 0, CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_INT, "inflight", SYSCTL_DESCR("File descriptors in flight"), NULL, 0, _rights, 0, CTL_NET, PF_LOCAL, CTL_CREATE, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, + sysctl_createv(_sysctllog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_INT, "deferred", SYSCTL_DESCR("File descriptors deferred for close"), Index: src/sys/rump/librump/rumpnet/net_stub.c diff -u src/sys/rump/librump/rumpnet/net_stub.c:1.40
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Fri Nov 6 12:23:10 UTC 2020 Modified Files: src/usr.sbin/sysinst: msg.entropy.de msg.entropy.en msg.entropy.es msg.entropy.fr msg.entropy.pl partitions.c partitions.h Log Message: Fix copy & pasted copyright comments. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/msg.entropy.de \ src/usr.sbin/sysinst/msg.entropy.en src/usr.sbin/sysinst/msg.entropy.es \ src/usr.sbin/sysinst/msg.entropy.fr src/usr.sbin/sysinst/msg.entropy.pl cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/partitions.c cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/partitions.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.sbin/sysinst/msg.entropy.de diff -u src/usr.sbin/sysinst/msg.entropy.de:1.1 src/usr.sbin/sysinst/msg.entropy.de:1.2 --- src/usr.sbin/sysinst/msg.entropy.de:1.1 Wed Nov 4 14:29:40 2020 +++ src/usr.sbin/sysinst/msg.entropy.de Fri Nov 6 12:23:10 2020 @@ -1,7 +1,7 @@ -/* $NetBSD: msg.entropy.de,v 1.1 2020/11/04 14:29:40 martin Exp $ */ +/* $NetBSD: msg.entropy.de,v 1.2 2020/11/06 12:23:10 martin Exp $ */ /* - * Copyright 2018 The NetBSD Foundation, Inc. + * Copyright (c) 2020 The NetBSD Foundation, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,18 +13,17 @@ *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ message not_enough_entropy Index: src/usr.sbin/sysinst/msg.entropy.en diff -u src/usr.sbin/sysinst/msg.entropy.en:1.1 src/usr.sbin/sysinst/msg.entropy.en:1.2 --- src/usr.sbin/sysinst/msg.entropy.en:1.1 Wed Nov 4 14:29:40 2020 +++ src/usr.sbin/sysinst/msg.entropy.en Fri Nov 6 12:23:10 2020 @@ -1,7 +1,7 @@ -/* $NetBSD: msg.entropy.en,v 1.1 2020/11/04 14:29:40 martin Exp $ */ +/* $NetBSD: msg.entropy.en,v 1.2 2020/11/06 12:23:10 martin Exp $ */ /* - * Copyright 2018 The NetBSD Foundation, Inc. + * Copyright (c) 2020 The NetBSD Foundation, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,18 +13,17 @@ *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * + * ARISING IN ANY WAY OUT OF THE USE OF THIS