Module Name: src
Committed By: uebayasi
Date: Mon Aug 31 02:58:25 UTC 2015
Modified Files:
src/usr.bin/config: defs.h gram.y main.c
Log Message:
Restore the old behavior of "maxusers" to allow the value to be overriden.
Problem reported by John D. Baker.
To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/config/defs.h
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/config/gram.y
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/config/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/config/defs.h
diff -u src/usr.bin/config/defs.h:1.73 src/usr.bin/config/defs.h:1.74
--- src/usr.bin/config/defs.h:1.73 Sun Aug 30 21:58:19 2015
+++ src/usr.bin/config/defs.h Mon Aug 31 02:58:25 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.73 2015/08/30 21:58:19 uebayasi Exp $ */
+/* $NetBSD: defs.h,v 1.74 2015/08/31 02:58:25 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
* The next two lines define the current version of the config(1) binary,
* and the minimum version of the configuration files it supports.
*/
-#define CONFIG_VERSION 20150833
+#define CONFIG_VERSION 20150834
#define CONFIG_MINVERSION 0
/*
@@ -610,6 +610,7 @@ int devbase_has_instances(struct devbase
int is_declared_option(const char *);
int deva_has_instances(struct deva *, int);
void setupdirs(void);
+void fixmaxusers(void);
void fixmkoption(void);
const char *strtolower(const char *);
Index: src/usr.bin/config/gram.y
diff -u src/usr.bin/config/gram.y:1.49 src/usr.bin/config/gram.y:1.50
--- src/usr.bin/config/gram.y:1.49 Sat Aug 29 14:07:45 2015
+++ src/usr.bin/config/gram.y Mon Aug 31 02:58:25 2015
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: gram.y,v 1.49 2015/08/29 14:07:45 uebayasi Exp $ */
+/* $NetBSD: gram.y,v 1.50 2015/08/31 02:58:25 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gram.y,v 1.49 2015/08/29 14:07:45 uebayasi Exp $");
+__RCSID("$NetBSD: gram.y,v 1.50 2015/08/31 02:58:25 uebayasi Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -760,13 +760,7 @@ select_options:
;
select_maxusers:
- MAXUSERS int32 {
- char str[32];
-
- setmaxusers($2);
- snprintf(str, sizeof(str), "%d", $2);
- addoption(intern("MAXUSERS"), intern(str));
- }
+ MAXUSERS int32 { setmaxusers($2); }
;
select_ident:
Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.80 src/usr.bin/config/main.c:1.81
--- src/usr.bin/config/main.c:1.80 Sun Aug 30 01:33:20 2015
+++ src/usr.bin/config/main.c Mon Aug 31 02:58:25 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.80 2015/08/30 01:33:20 uebayasi Exp $ */
+/* $NetBSD: main.c,v 1.81 2015/08/31 02:58:25 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: main.c,v 1.80 2015/08/30 01:33:20 uebayasi Exp $");
+__RCSID("$NetBSD: main.c,v 1.81 2015/08/31 02:58:25 uebayasi Exp $");
#ifndef MAKE_BOOTSTRAP
#include <sys/cdefs.h>
@@ -429,6 +429,12 @@ main(int argc, char **argv)
stop();
/*
+ * Copy maxusers to param.
+ */
+ yyfile = "fixmaxusers";
+ fixmaxusers();
+
+ /*
* Copy makeoptions to params
*/
yyfile = "fixmkoption";
@@ -1104,6 +1110,18 @@ appendcondmkoption(struct condexpr *cond
}
/*
+ * Copy maxusers to param "MAXUSERS".
+ */
+void
+fixmaxusers(void)
+{
+ char str[32];
+
+ snprintf(str, sizeof(str), "%d", maxusers);
+ addoption(intern("MAXUSERS"), intern(str));
+}
+
+/*
* Copy makeoptions to params with "makeoptions_" prefix.
*/
void