aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-04-14 21:20:54 -0400
committerRich Salz <rsalz@openssl.org>2017-04-16 07:57:12 -0400
commitcad3f9dacbd03ea686a26690c8f4e58866d08104 (patch)
tree274761c6135ad55c00c100375f415c80d684b7bc /util
parent7db0289ea70b9bec94e32350cc8ec9da96ab2776 (diff)
downloadopenssl-cad3f9dacbd03ea686a26690c8f4e58866d08104.tar.gz
Add -f -r flags to find-unused-errs
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3230)
Diffstat (limited to 'util')
-rwxr-xr-xutil/find-unused-errs21
1 files changed, 20 insertions, 1 deletions
diff --git a/util/find-unused-errs b/util/find-unused-errs
index 68cf66b15f..cd1026d594 100755
--- a/util/find-unused-errs
+++ b/util/find-unused-errs
@@ -13,8 +13,27 @@
export X1=/tmp/f.1.$$
export X2=/tmp/f.2.$$
+case "$1" in
+ -f)
+ PAT='_F_'
+ echo Functions only
+ ;;
+ -[er])
+ PAT='_R_'
+ echo Reason codes only
+ ;;
+ "")
+ PAT='_[FR]_'
+ echo Function and reasons
+ ;;
+ *)
+ echo "Usage error; one of -[efr] required."
+ exit 1;
+ ;;
+esac
+
cd include/openssl || exit 1
-grep '_[RF]_' * | awk '{print $3;}' | sort -u >$X1
+grep "$PAT" * | grep -v ERR_FATAL_ERROR | awk '{print $3;}' | sort -u >$X1
cd ../..
for F in `cat $X1` ; do