aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config/mkoptions.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2010-07-15 22:28:19 +0000
committerWarner Losh <imp@FreeBSD.org>2010-07-15 22:28:19 +0000
commit5eb0164407616d7223cc4851cf3d8bd6df3ee9c5 (patch)
tree93c35caf4d3e598d0da64a1572a4e10d9eb9943e /usr.sbin/config/mkoptions.c
parent4fc94b98b1908ba39e80bf8d26927c2b08cc25f2 (diff)
downloadsrc-5eb0164407616d7223cc4851cf3d8bd6df3ee9c5.tar.gz
src-5eb0164407616d7223cc4851cf3d8bd6df3ee9c5.zip
Put warnings out to stderr rather than stdout.
MFC after: 3 days
Notes
Notes: svn path=/head/; revision=210144
Diffstat (limited to 'usr.sbin/config/mkoptions.c')
-rw-r--r--usr.sbin/config/mkoptions.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index 2992ec35ad73..efa89728cd00 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -77,12 +77,14 @@ options(void)
}
if (maxusers == 0) {
- /* printf("maxusers not specified; will auto-size\n"); */
+ /* fprintf(stderr, "maxusers not specified; will auto-size\n"); */
} else if (maxusers < users.u_min) {
- printf("minimum of %d maxusers assumed\n", users.u_min);
+ fprintf(stderr, "minimum of %d maxusers assumed\n",
+ users.u_min);
maxusers = users.u_min;
} else if (maxusers > users.u_max)
- printf("warning: maxusers > %d (%d)\n", users.u_max, maxusers);
+ fprintf(stderr, "warning: maxusers > %d (%d)\n",
+ users.u_max, maxusers);
/* Fake MAXUSERS as an option. */
op = (struct opt *)calloc(1, sizeof(*op));
@@ -112,7 +114,7 @@ options(void)
SLIST_FOREACH(ol, &otab, o_next) {
if (eq(op->op_name, ol->o_name) &&
(ol->o_flags & OL_ALIAS)) {
- printf("Mapping option %s to %s.\n",
+ fprintf(stderr, "Mapping option %s to %s.\n",
op->op_name, ol->o_file);
op->op_name = ol->o_file;
break;
@@ -123,7 +125,7 @@ options(void)
do_option(ol->o_name);
SLIST_FOREACH(op, &opt, op_next) {
if (!op->op_ownfile && strncmp(op->op_name, "DEV_", 4)) {
- printf("%s: unknown option \"%s\"\n",
+ fprintf(stderr, "%s: unknown option \"%s\"\n",
PREFIX, op->op_name);
exit(1);
}
@@ -160,7 +162,7 @@ do_option(char *name)
if (value == NULL)
value = ns("1");
if (oldvalue != NULL && !eq(value, oldvalue))
- printf(
+ fprintf(stderr,
"%s: option \"%s\" redefined from %s to %s\n",
PREFIX, op->op_name, oldvalue,
value);
@@ -218,12 +220,14 @@ do_option(char *name)
if (eq(inw, ol->o_name))
break;
if (!eq(inw, name) && !ol) {
- printf("WARNING: unknown option `%s' removed from %s\n",
- inw, file);
+ fprintf(stderr,
+ "WARNING: unknown option `%s' removed from %s\n",
+ inw, file);
tidy++;
} else if (ol != NULL && !eq(basefile, ol->o_file)) {
- printf("WARNING: option `%s' moved from %s to %s\n",
- inw, basefile, ol->o_file);
+ fprintf(stderr,
+ "WARNING: option `%s' moved from %s to %s\n",
+ inw, basefile, ol->o_file);
tidy++;
} else {
op = (struct opt *) calloc(1, sizeof *op);
@@ -312,8 +316,8 @@ check_duplicate(const char *fname, const char *this)
SLIST_FOREACH(po, &otab, o_next) {
if (eq(po->o_name, this)) {
- printf("%s: Duplicate option %s.\n",
- fname, this);
+ fprintf(stderr, "%s: Duplicate option %s.\n",
+ fname, this);
exit(1);
}
}
@@ -347,7 +351,8 @@ update_option(const char *this, char *val, int flags)
return;
}
}
- printf("Compat option %s not listed in options file.\n", this);
+ fprintf(stderr, "Compat option %s not listed in options file.\n",
+ this);
exit(1);
}
@@ -375,8 +380,8 @@ read_option_file(const char *fname, int flags)
return (1);
if (val == 0) {
if (flags) {
- printf("%s: compat file requires two words "
- "per line at %s\n", fname, this);
+ fprintf(stderr, "%s: compat file requires two"
+ " words per line at %s\n", fname, this);
exit(1);
}
char *s = ns(this);