Add -q (quiet) option, or look for a V option in the environment
diff --git a/klibc/makeerrlist.pl b/klibc/makeerrlist.pl
index 00acb8a..d5182a2 100644
--- a/klibc/makeerrlist.pl
+++ b/klibc/makeerrlist.pl
@@ -20,7 +20,7 @@
$file = $rootdir.$file;
- print STDERR "opening $file\n";
+ print STDERR "opening $file\n" unless ( $quiet );
if ( !($fh->open("< ".$file)) ) {
die "$0: cannot open $file\n";
@@ -38,7 +38,7 @@
$error = $1;
$errno = $2+0;
$msg = $3;
- print STDERR "$error ($errno) => \"$msg\"\n";
+ print STDERR "$error ($errno) => \"$msg\"\n" unless ( $quiet );
$errors{$errno} = $error;
$errmsg{$errno} = $msg;
$maxerr = $errno if ( $errno > $maxerr );
@@ -53,9 +53,24 @@
print STDERR "closing $file\n";
}
-parse_file('linux/errno.h');
+$v = getenv("V");
+if ( defined($v) ) {
+ $quiet = !$v;
+} else {
+ $quiet = 0;
+}
-($type) = @ARGV;
+foreach $arg ( @ARGV ) {
+ if ( $arg eq '-q' ) {
+ $quiet = 1;
+ } elsif ( $arg =~ /^-(errlist|errnos|maxerr)$/ ) {
+ $type = $arg;
+ } else {
+ die "$0: Unknown option: $arg\n";
+ }
+}
+
+parse_file('linux/errno.h');
if ( $type eq '-errlist' ) {
print "#include <errno.h>\n";