diff options
| author | Diomidis Spinellis <dds@FreeBSD.org> | 2006-05-30 21:13:28 +0000 |
|---|---|---|
| committer | Diomidis Spinellis <dds@FreeBSD.org> | 2006-05-30 21:13:28 +0000 |
| commit | 44d6e87b071611ec7ca46bd1a28a1e73917dfe12 (patch) | |
| tree | 8ec7d1d25ac89b42f433912584ec6624d8fa8478 /sys/tools/vnode_if.awk | |
| parent | f69ec7af12da527683b30cbc805bc57c90d56d1f (diff) | |
Notes
Diffstat (limited to 'sys/tools/vnode_if.awk')
| -rw-r--r-- | sys/tools/vnode_if.awk | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 54ee3a15d3e3..fa168cb54a88 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -47,6 +47,7 @@ function usage() function die(msg, what) { + printf srcfile "(" fnr "): " > "/dev/stderr"; printf msg "\n", what > "/dev/stderr"; exit 1; } @@ -189,13 +190,16 @@ if (cfile) { } while ((getline < srcfile) > 0) { + fnr++; if (NF == 0) continue; if ($1 ~ /^%%/) { - if (NF != 6 || $1 != "%%" || \ - $2 !~ /^[a-z]+$/ || $3 !~ /^[a-z]+$/ || \ - $4 !~ /^.$/ || $5 !~ /^.$/ || $6 !~ /^.$/) + if (NF != 6 || + $2 !~ /^[a-z]+$/ || $3 !~ /^[a-z]+$/ || + $4 !~ /^.$/ || $5 !~ /^.$/ || $6 !~ /^.$/) { + die("Invalid %s construction", "%%"); continue; + } lockdata["vop_" $2, $3, "Entry"] = $4; lockdata["vop_" $2, $3, "OK"] = $5; lockdata["vop_" $2, $3, "Error"] = $6; @@ -203,14 +207,15 @@ while ((getline < srcfile) > 0) { } if ($1 ~ /^%!/) { - if (NF != 4 || $1 != "%!") - continue; - if ($3 != "pre" && $3 != "post") + if (NF != 4 || + ($3 != "pre" && $3 != "post")) { + die("Invalid %s construction", "%!"); continue; + } lockdata["vop_" $2, $3] = $4; continue; } - if ($1 ~ /^#/ || $0 ~ /^$/) + if ($1 ~ /^#/) continue; # Get the function name. @@ -225,6 +230,7 @@ while ((getline < srcfile) > 0) { die("Unable to read through the arguments for \"%s\"", name); } + fnr++; if ($1 ~ /^\};/) break; |
