From db5ce51427906ed54aa3e8e1dffc0ba6d908aa8c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 12 Jan 2011 09:22:12 -0800 Subject: Fix non-static instances of "struct vlog_rate_limit" and add check. A non-static vlog_rate_limit is not actually going to rate-limit anything. --- Makefile.am | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 689fd6cc3..deae5127d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -124,6 +124,17 @@ distfiles: Makefile -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ CLEANFILES += distfiles +# Check that "struct vlog_ratelimit" is always declared "static". +ALL_LOCAL += rate-limit-check +rate-limit-check: + @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ + git --no-pager grep -n -E '^[ ]+struct vlog_rate_limit.*=' $(srcdir); \ + then \ + echo "See above for list of violations of the rule that "; \ + echo "'struct vlog_rate_limit' must always be 'static'"; \ + exit 1; \ + fi + dist-hook: $(DIST_HOOKS) all-local: $(ALL_LOCAL) clean-local: $(CLEAN_LOCAL) -- cgit v1.2.1