From bf0075bfecb8e3b9d39b60db766f5967be908a74 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 15 Jul 2010 22:28:19 +0000 Subject: Put warnings out to stderr rather than stdout. MFC after: 3 days --- usr.sbin/config/mkoptions.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'usr.sbin/config/mkoptions.c') diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c index 2992ec3..efa8972 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); -- cgit v1.1