mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Add a new syntax-check rule for gethostname.
We should always be using virGetHostname in place of gethostname; thus add in a new syntax-check rule to make sure no new uses creep in. Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
parent
4c893ef9be
commit
d27098c054
2
.x-sc_prohibit_gethostname
Normal file
2
.x-sc_prohibit_gethostname
Normal file
@ -0,0 +1,2 @@
|
||||
^src/util/util\.c$
|
||||
^ChangeLog-old$
|
@ -23,6 +23,7 @@ EXTRA_DIST = \
|
||||
.x-sc_m4_quote_check \
|
||||
.x-sc_prohibit_asprintf \
|
||||
.x-sc_prohibit_gethostby \
|
||||
.x-sc_prohibit_gethostname \
|
||||
.x-sc_prohibit_have_config_h \
|
||||
.x-sc_prohibit_HAVE_MBRTOWC \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
|
5
cfg.mk
5
cfg.mk
@ -94,6 +94,11 @@ sc_prohibit_strncpy:
|
||||
msg='use virStrncpy, not strncpy' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_gethostname:
|
||||
@re='gethostname *\(' \
|
||||
msg='use virGetHostname, not gethostname' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
@re='\<V''IR_ERR_NO_MEMORY\>' \
|
||||
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
|
@ -1441,7 +1441,7 @@ error:
|
||||
* @conn: pointer to a hypervisor connection
|
||||
*
|
||||
* This returns the system hostname on which the hypervisor is
|
||||
* running (the result of the gethostname(2) system call). If
|
||||
* running (the result of the gethostname system call). If
|
||||
* we are connected to a remote system, then this returns the
|
||||
* hostname of the remote system.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user