diff options
author | Warner Losh <imp@FreeBSD.org> | 2010-07-15 22:28:19 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2010-07-15 22:28:19 +0000 |
commit | 5eb0164407616d7223cc4851cf3d8bd6df3ee9c5 (patch) | |
tree | 93c35caf4d3e598d0da64a1572a4e10d9eb9943e /usr.sbin/config/mkmakefile.c | |
parent | 4fc94b98b1908ba39e80bf8d26927c2b08cc25f2 (diff) | |
download | src-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/mkmakefile.c')
-rw-r--r-- | usr.sbin/config/mkmakefile.c | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 1a5a547c6ef6..6a59698e18ec 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -341,7 +341,8 @@ next: if (eq(wd, "include")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: missing include filename.\n", fname); + fprintf(stderr, "%s: missing include filename.\n", + fname); exit(1); } (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); @@ -353,8 +354,7 @@ next: this = ns(wd); next_word(fp, wd); if (wd == 0) { - printf("%s: No type for %s.\n", - fname, this); + fprintf(stderr, "%s: No type for %s.\n", fname, this); exit(1); } tp = fl_lookup(this); @@ -381,8 +381,9 @@ next: } else if (eq(wd, "mandatory")) { mandatory = 1; } else if (!eq(wd, "optional")) { - printf("%s: %s must be optional, mandatory or standard\n", - fname, this); + fprintf(stderr, + "%s: %s must be optional, mandatory or standard\n", + fname, this); exit(1); } nextparam: @@ -395,7 +396,7 @@ nextparam: } if (eq(wd, "|")) { if (nreqs == 0) { - printf("%s: syntax error describing %s\n", + fprintf(stderr, "%s: syntax error describing %s\n", fname, this); exit(1); } @@ -410,9 +411,9 @@ nextparam: } if (eq(wd, "no-implicit-rule")) { if (compilewith == 0) { - printf("%s: alternate rule required when " - "\"no-implicit-rule\" is specified.\n", - fname); + fprintf(stderr, "%s: alternate rule required when " + "\"no-implicit-rule\" is specified.\n", + fname); } imp_rule++; goto nextparam; @@ -424,8 +425,9 @@ nextparam: if (eq(wd, "dependency")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing compile command string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing compile command string.\n", + fname, this); exit(1); } depends = ns(wd); @@ -434,8 +436,8 @@ nextparam: if (eq(wd, "clean")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing clean file list.\n", - fname, this); + fprintf(stderr, "%s: %s missing clean file list.\n", + fname, this); exit(1); } clean = ns(wd); @@ -444,8 +446,9 @@ nextparam: if (eq(wd, "compile-with")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing compile command string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing compile command string.\n", + fname, this); exit(1); } compilewith = ns(wd); @@ -454,8 +457,9 @@ nextparam: if (eq(wd, "warning")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing warning text string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing warning text string.\n", + fname, this); exit(1); } warning = ns(wd); @@ -484,13 +488,14 @@ nextparam: goto nextparam; } if (mandatory) { - printf("%s: mandatory device \"%s\" not found\n", + fprintf(stderr, "%s: mandatory device \"%s\" not found\n", fname, wd); exit(1); } if (std) { - printf("standard entry %s has a device keyword - %s!\n", - this, wd); + fprintf(stderr, + "standard entry %s has a device keyword - %s!\n", + this, wd); exit(1); } SLIST_FOREACH(op, &opt, op_next) @@ -501,13 +506,13 @@ nextparam: doneparam: if (std == 0 && nreqs == 0) { - printf("%s: what is %s optional on?\n", + fprintf(stderr, "%s: what is %s optional on?\n", fname, this); exit(1); } if (wd) { - printf("%s: syntax error describing %s\n", + fprintf(stderr, "%s: syntax error describing %s\n", fname, this); exit(1); } @@ -687,7 +692,7 @@ do_rules(FILE *f) STAILQ_FOREACH(ftp, &ftab, f_next) { if (ftp->f_warn) - printf("WARNING: %s\n", ftp->f_warn); + fprintf(stderr, "WARNING: %s\n", ftp->f_warn); cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1; och = *cp; if (ftp->f_flags & NO_IMPLCT_RULE) { @@ -732,7 +737,8 @@ do_rules(FILE *f) ftype = "PROFILE"; break; default: - printf("config: don't know rules for %s\n", np); + fprintf(stderr, + "config: don't know rules for %s\n", np); break; } snprintf(cmd, sizeof(cmd), |