From: Eric Blake Date: Sat, 20 Nov 2010 00:25:23 +0000 (-0700) Subject: build: enforce files.h usage X-Git-Tag: v0.8.6~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1fe9671e301d479c9296c08d1b9e14b4e4fe378;p=thirdparty%2Flibvirt.git build: enforce files.h usage * cfg.mk (sc_prohibit_close): New syntax-check rule. * src/util/pci.c (pciWaitForDeviceCleanup): Fix violation. * .x-sc_prohibit_close: New exceptions. * Makefile.am (EXTRA_DIST): Distribute new file. --- diff --git a/.x-sc_prohibit_close b/.x-sc_prohibit_close new file mode 100644 index 0000000000..348200c337 --- /dev/null +++ b/.x-sc_prohibit_close @@ -0,0 +1,3 @@ +^docs/.* +^HACKING$ +^src/util/files.c$ diff --git a/Makefile.am b/Makefile.am index d3f8876b23..bf1b49b515 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,7 @@ EXTRA_DIST = \ .x-sc_bindtextdomain \ .x-sc_m4_quote_check \ .x-sc_prohibit_asprintf \ + .x-sc_prohibit_close \ .x-sc_prohibit_empty_lines_at_EOF \ .x-sc_prohibit_gethostby \ .x-sc_prohibit_gethostname \ diff --git a/cfg.mk b/cfg.mk index 0851f44a8c..963c7db384 100644 --- a/cfg.mk +++ b/cfg.mk @@ -231,6 +231,15 @@ sc_avoid_write: halt='consider using safewrite instead of write' \ $(_sc_search_regexp) +# Avoid functions that can lead to double-close bugs. +sc_prohibit_close: + @prohibit='\<[f]close *\(' \ + halt='use VIR_{FORCE_}[F]CLOSE instead of [f]close' \ + $(_sc_search_regexp) + @prohibit='\