summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-07-15 04:45:24 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-07-15 04:45:24 +0000
commit7bd73b069cd7960c9352342e6728c094f740b63f (patch)
treee0d5b4553129251df4c6755401a2460f57dbafa8
parentda6303bacc790f76845320b1d0effb73d1557a47 (diff)
Notes
-rw-r--r--usr.bin/checknr/checknr.c3
-rw-r--r--usr.bin/fmt/fmt.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index 30527bda7fc9..742c74e5de60 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
* later but for now think of these restrictions as contributions to
* structured typesetting.
*/
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -257,7 +258,7 @@ main(int argc, char **argv)
cfilename = argv[i];
f = fopen(cfilename, "r");
if (f == NULL)
- perror(cfilename);
+ warn("%s", cfilename);
else {
process(f);
fclose(f);
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index 0ad2bbc68596..a8662fdcf3e3 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -362,7 +362,7 @@ main(int argc, char *argv[]) {
static void
process_named_file(const char *name) {
FILE *f=fopen(name, "r");
- if (!f) { perror(name); ++n_errors; }
+ if (!f) { warn("%s", name); ++n_errors; }
else {
process_stream(f, name);
fclose(f);
@@ -459,7 +459,7 @@ process_stream(FILE *stream, const char *name) {
++para_line_number;
}
new_paragraph(output_in_paragraph ? last_indent : first_indent, 0);
- if (ferror(stream)) { perror(name); ++n_errors; }
+ if (ferror(stream)) { warn("%s", name); ++n_errors; }
}
/* How long is the indent on this line?
@@ -586,7 +586,7 @@ center_stream(FILE *stream, const char *name) {
fwrite(line, 1, length, stdout);
putchar('\n');
}
- if (ferror(stream)) { perror(name); ++n_errors; }
+ if (ferror(stream)) { warn("%s", name); ++n_errors; }
}
/* Get a single line from a stream. Expand tabs, strip control