syntax-check: prohibit all new uses of gethostby* functions

* Makefile.maint (sc_prohibit_gethostby): New rule.
* .x-sc_prohibit_gethostby: Exempt the few existing uses.
This commit is contained in:
Jim Meyering 2008-12-11 15:14:03 +00:00
parent 63efdb85c1
commit be2d2e06e2
3 changed files with 15 additions and 0 deletions

3
.x-sc_prohibit_gethostby Normal file
View File

@ -0,0 +1,3 @@
gnulib/lib/getaddrinfo.c
gnulib/m4/getaddrinfo.m4
src/xend_internal.c

View File

@ -1,3 +1,9 @@
Thu Dec 11 16:13:08 +0100 2008 Jim Meyering <meyering@redhat.com>
syntax-check: prohibit all new uses of gethostby* functions
* Makefile.maint (sc_prohibit_gethostby): New rule.
* .x-sc_prohibit_gethostby: Exempt the few existing uses.
Thu Dec 11 10:03:00 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/test.c: Fix locking issue in test driver VolLookupByPath

View File

@ -390,6 +390,12 @@ sc_prohibit_virBufferAdd_with_string_literal:
{ echo '$(ME): use virBufferAddLit, not virBufferAdd,' \
'with a string literal' 1>&2; exit 1; } || :
# Not only do they fail to deal well with ipv6, but the gethostby*
# functions are also not thread-safe.
sc_prohibit_gethostby:
@grep -nE '\<gethostby(addr|name2?) *\(' $$($(VC_LIST_EXCEPT)) && \
{ echo '$(ME): use getaddrinfo, not gethostby*' 1>&2; exit 1; } || :
# Avoid useless parentheses like those in this example:
# #if defined (SYMBOL) || defined (SYM2)
sc_useless_cpp_parens: